-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Cannot install scipy or anything that depends on it, like scikit-learn via pip #558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
See #540 I also came across this neat support matrix for what packages support Python 3.9
Using python 3.8 works fine $ docker build -t python:test - << EOF
FROM python:3.8-slim
RUN apt-get update && apt-get install -y --no-install-recommends gfortran libopenblas-dev liblapack-dev && rm -rf /var/lib/apt/lists/*
RUN pip3 install cython
RUN pip3 install numpy==1.17.2
RUN apt update && apt install -y --no-install-recommends g++ && pip3 install scikit-learn[alldeps]==0.21.1 && apt remove -y g++ && rm -rf /var/lib/apt/lists/*
EOF
Sending build context to Docker daemon 2.048kB
Step 1/5 : FROM python:3.8-slim
---> 0f59d947500d
Step 2/5 : RUN apt-get update && apt-get install -y --no-install-recommends gfortran libopenblas-dev liblapack-dev && rm -rf /var/lib/apt/lists/*
---> Using cache
---> 006a4eb6efa7
Step 3/5 : RUN pip3 install cython
---> Using cache
---> 46b0efff21a1
Step 4/5 : RUN pip3 install numpy==1.17.2
---> Using cache
---> 0b930b8f4d7f
Step 5/5 : RUN apt update && apt install -y --no-install-recommends g++ && pip3 install scikit-learn[alldeps]==0.21.1 && apt remove -y g++ && rm -rf /var/lib/apt/lists/*
---> Using cache
---> 39ee4a2fc474
Successfully built 39ee4a2fc474
Successfully tagged python:test
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
python test 39ee4a2fc474 About a minute ago 637MB
python 3.8-slim 0f59d947500d 21 hours ago 113MB |
Thanks for the explanation about incompatibilities with Python 3.9. I'm not normally a Python developer so I didn't realize 3.9 wasn't compatible with 3.7.x (it's too bad that they don't follow semver guidelines). Closing. |
python3 -m pip install --upgrade pip |
RUN python3.10 -m pip install --upgrade pip |
This image makes it very difficult (impossible?) to install numpy, scipy, and scikit-learn via pip, which as per #43 should be the recommended method. As I noted in a comment to that issue which was marked as spam (I admit the comment may have been unhelpful, but it certainly wasn't spam), this does not seem to work well.
Example
Dockerfile
:and
requirements.txt
as recommended by the scikit docs (https://scikit-learn.org/stable/install.html#install-official-release):results in output like this:
Noticing the message "No lapack/blas resources found." and updating the Dockerfile to include those system libraries:
still results in a failure (shortened for brevity):
and now installing cython explicitly by adding a
pip install --user cython
before installingrequirements.txt
:I'm building with podman 2.1.1.
When using
FROM debian:buster
, the same build works without any issues. I'm fine with usingdebian:buster
but can either the image or the documentation be updated to explain why this usage of pip in this image does not work, and/or document how to make it work?The text was updated successfully, but these errors were encountered: