因此,我最近尝试使用sudo pip install scipy在我的Raspbian (Debian for Raspberry Pi)操作系统上安装scipy。该命令运行时没有太多问题,我可以看到位于pi/build/scipy下的文件。
但是,当我实际尝试将它导入到python程序中时,它会给我ImportError: No module named scipy,我真的不确定如何将OS指向正确的位置以导入scipy模块。
发布于 2014-07-08 04:48:32
除非你在pip环境中,否则它根本不会工作。我建议您改为安装python-scipy包,这将确保您能够正常工作:
➜ ~ sudo apt-get install python-scipy
Selecting previously unselected package python-decorator.
(Reading database ... 252269 files and directories currently installed.)
Preparing to unpack .../python-decorator_3.4.0-2_all.deb ...
Unpacking python-decorator (3.4.0-2) ...
Selecting previously unselected package python-scipy.
Preparing to unpack .../python-scipy_0.13.3-2+b1_i386.deb ...
Unpacking python-scipy (0.13.3-2+b1) ...
Setting up python-decorator (3.4.0-2) ...
Setting up python-scipy (0.13.3-2+b1) ...
➜ ~ python
Python 2.7.7 (default, Jun 3 2014, 23:36:29)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
>>> 发布于 2014-07-08 04:42:16
我认为在使用sudo pip安装后,您的权限有问题。(
此问题的快速解决方案可能是将scipy与
sudo -i
pip install scipy要使sudo-install正常工作,您可能需要更改默认umask (umask 0022)。
https://stackoverflow.com/questions/24619015
复制相似问题