ImportError:没有名为 scipy 的模块

新手上路,请多包涵

我正在使用 Python 2.7 并试图让 PyBrain 工作。

但是即使安装了 scipy 我也会收到此错误-

 Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/PyBrain-0.3.1-
py2.7.egg/pybrain/__init__.py", line 1, in <module>
    from pybrain.structure.__init__ import *
  File "/usr/local/lib/python2.7/site-packages/PyBrain-0.3.1-py2.7.egg/pybrain/structure/__init__.py", line 1, in <module>
    from pybrain.structure.connections.__init__ import *
  File "/usr/local/lib/python2.7/site-packages/PyBrain-0.3.1-py2.7.egg/pybrain/structure/connections/__init__.py", line 1, in <module>
    from pybrain.structure.connections.full import FullConnection
  File "/usr/local/lib/python2.7/site-packages/PyBrain-0.3.1-py2.7.egg/pybrain/structure/connections/full.py", line 3, in <module>
    from scipy import reshape, dot, outer
ImportError: No module named scipy

我已经使用这个命令安装了 scipy -

 sudo apt-get install python-scipy

我得到 -

 Reading package lists... Done
Building dependency tree
Reading state information... Done
python-scipy is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

我应该怎么办?

原文由 ihmpall 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 716
2 个回答

尝试使用 pip 将其安装为 python 包。你说你已经试过了:

 sudo apt-get install python-scipy

现在运行:

 pip install scipy

我运行了两者,它在我的基于 Debian 的机器上运行。

原文由 BostonGeorge 发布,翻译遵循 CC BY-SA 4.0 许可协议

为确保轻松正确地安装 python,请从一开始就使用 pip

安装点子:

 $ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python2 get-pip.py   # for python 2.7
$ sudo python3 get-pip.py   # for python 3.x

使用 pip 安装 scipy:

 $ pip2 install scipy    # for python 2.7
$ pip3 install scipy    # for python 3.x

原文由 user5747799 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题