I'm trying to setup unit tests in Bitbucket using the following
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
We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events