Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket: ModuleNotFoundError: No module named 'numpy'

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'

 

1 answer

1 vote

@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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

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...

2,186 views 45 15
Read article

Community Events

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

Events near you