piwheels / packages

Issue tracker for piwheels package issues
https://github.com/piwheels/packages/issues
20 stars 5 forks source link

Numpy needs libatlas-base-dev but I cannot install it #247

Closed Lorena123456789 closed 2 years ago

Lorena123456789 commented 2 years ago

I'm trying to install numpy in a docker container for my armv7 architecture system (not a raspberry pi) with Python 3.7 and Debian Buster.

The build works fine but when the container is running it has the error log:

ImportError: Unable to import required dependencies:
numpy:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.7 from "/usr/local/bin/python"
  * The NumPy version is: "1.21.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory

The python and numpy versions are the versions I expect.

So I tried to install "libatlas-base-dev" as recommended here with: apt-get install libatlas-base-dev

But then I get this error message during the docker image build:

> [5/7] RUN apt-get install libatlas-base-dev:

#9 1.109 E: Unable to locate package libatlas-base-dev
------
error: failed to solve: executor failed running [/bin/sh -c apt-get install libatlas-base-dev]: exit code: 100

I tryed also to install with apt install libatlas3-base libgfortran5 like its recommended here

Then I got this error during the build:

> [5/7] RUN apt install libatlas3-base libgfortran5:

#9 1.093 Reading state information...
#9 1.147 E: Unable to locate package libatlas3-base
#9 1.147 E: Unable to locate package libgfortran5
------
error: failed to solve: executor failed running [/bin/sh -c apt install libatlas3-base libgfortran5]: exit code: 100

So what can I do to solve the problem?

Thank you for any help!

bennuttall commented 2 years ago

You may need to change your base Debian image to one that includes those packages. Are you using slim maybe? Try the full instead? It needs to be the armhf image.

I can't really help you beyond that - it's a Docker issue rather than a piwheels issue.

wiah commented 2 years ago

@Lorena123456789 Did you manage to find a fix to the issue? I'm facing the exact same issue at the moment.

Lorena123456789 commented 2 years ago

@wiah Yes! I ended up with using wheels from piwheels.org. For the wheel installation from piwheels.org I had to add the URL of piwheels in pip.config of my system. Then I had to add the URL of packages.debian.org/buster/armhf/libatlas-base-dev/download to sourced.list of the system so that libatlas-base-dev could be installed.