fkrull/docker-multi-python

`import numpy` fails in Python 3.9 on fkrull/multi-python:focal

shunichironomura opened this issue · 0 comments

How to reproduce the issue

Run a docker container based on the image:

docker run -it fkrull/multi-python:focal sh

Install numpy and import it inside the container:

python3.9 -m pip install numpy && python3.9 -c "import numpy"

Output

Collecting numpy
  Downloading numpy-1.20.1-cp39-cp39-manylinux2010_x86_64.whl (15.4 MB)
     |████████████████████████████████| 15.4 MB 7.8 MB/s
Installing collected packages: numpy
Successfully installed numpy-1.20.1
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.9/dist-packages/numpy/__init__.py", line 156, in <module>
    from . import random
  File "/usr/local/lib/python3.9/dist-packages/numpy/random/__init__.py", line 179, in <module>
    from . import _pickle
  File "/usr/local/lib/python3.9/dist-packages/numpy/random/_pickle.py", line 1, in <module>
    from .mtrand import RandomState
ImportError: /usr/local/lib/python3.9/dist-packages/numpy/random/mtrand.cpython-39-x86_64-linux-gnu.so: undefined symbol: PyCMethod_New

System specifications

  • Windows Docker Desktop with WSL2 backend
  • Docker Engine v20.10.5