I'm trying to setup unit tests in Bitbucket using the following bitbucket-pipelines.yml
image: python:3.7.3
pipelines:
default:
- step:
caches:
- pip
script: # Modify the commands below to build your repository.
- pip3 install --upgrade pip setuptools wheel
- pip3 install -r requirements.txt
- step:
script:
- python3 -m unittest discover -vp 'Test*.py'
The file requirements.txt is the following:
tensorflow==2.4.1
Keras==2.4.3
pandas==1.1.3
requests==2.24.0
matplotlib==3.3.2
numpy==1.19.2
numpy is present in the requirements but when it runs the unit tests, I get the following error:
import numpy as np
ModuleNotFoundError: No module named 'numpy'
@stefanoc this means , that when you install dependencies, they failed to install. The possible reason is that you freeze version, and some package, for example, pandas, require numpy of another version, BUT you have a conflict here.
Try to install it locally and ensure you have latest pip package manager, they recently did very major update that shows this error, I explained above.
While installing locally, you will see the error or will manually check if the package is installed indeed.
I just tried to install you requirements and got:
```(.venv) ➜ my-dir ✗ pip install -r requirements.txt
ERROR: Could not find a version that satisfies the requirement tensorflow==2.4.1
ERROR: No matching distribution found for tensorflow==2.4.1
```
So pay attention to this and ensure you have python and pip of required version
Regards, Galyna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.