Unable to import numpy: Error: /usr/lib/liblapack.so.3: undefined symbol: gotoblas

前端 未结 2 636
旧巷少年郎
旧巷少年郎 2021-01-17 19:20

When I try to import numpy, I get the following error:

/usr/local/lib/python2.7/dist-packages/numpy/linalg/__init__.py in ()
     49 from .info         


        
2条回答
  •  孤城傲影
    2021-01-17 20:19

    The error message shows that your numpy installation is in '/usr/local/lib', but apt-get will put numpy in '/usr/lib'. This suggests to me that you have another copy of numpy which was installed by another method (e.g. pip install). Check if you have a directory called /usr/lib/python2.7/dist-packages/numpy/. If so, you just need to make sure that Python imports numpy from here and not from '/usr/local/lib'.

    Try deleting, renaming or moving the directory /usr/local/lib/python2.7/dist-packages/numpy/, alternatively you can change sys.path from within Python.

提交回复
热议问题