在 Python 3 上安装 scipy 时出现问题

在 Python 3 上安装 scipy 时出现问题

我在 Rasbpian 上运行 Linux,并使用 Python 3.7.3。我已经尝试安装 scipy 好几天了,但没有成功。

我尝试过 pip、pip3、apt-get 等。我什至尝试卸载并重新安装 numpy 但没有用。

它产生这个错误:

   Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-fc2cutln/scipy/setup.py", line 540, in <module>
        setup_package()
      File "/tmp/pip-install-fc2cutln/scipy/setup.py", line 516, in setup_package
        from numpy.distutils.core import setup
      File "/tmp/pip-build-env-x0_6h9tn/lib/python3.7/site-packages/numpy/__init__.py", line 142, in <module>
        from . import add_newdocs
      File "/tmp/pip-build-env-x0_6h9tn/lib/python3.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
        from numpy.lib import add_newdoc
      File "/tmp/pip-build-env-x0_6h9tn/lib/python3.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
        from .type_check import *
      File "/tmp/pip-build-env-x0_6h9tn/lib/python3.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
        import numpy.core.numeric as _nx
      File "/tmp/pip-build-env-x0_6h9tn/lib/python3.7/site-packages/numpy/core/__init__.py", line 26, in <module>
        raise ImportError(msg)
    ImportError:
    Importing the multiarray numpy extension module failed.  Most
    likely you are trying to import a failed build of numpy.
    If you're working with a numpy git repo, try `git clean -xdf` (removes all
    files not under version control).  Otherwise reinstall numpy.

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

答案1

来源: https://stackoverflow.com/questions/55252264/importerror-libf77blas-so-3-cannot-open-shared-object-file-no-such-file-or-di

您可能只需要安装 libatlas 的开发库:

sudo apt install libatlas-base-dev

然后重试:

pip install scipy

相关内容