bash Python:ImportError:没有名为numpy的模块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35408667/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 14:14:57  来源:igfitidea点击:

Python : ImportError: No module named numpy

pythonbashnumpypip

提问by Andriy Ivaneyko

I am trying to run the bash script and i am repeatedly incurring following error

我正在尝试运行 bash 脚本,但我反复出现以下错误

File "/usr/share/fsl/5.0/bin/aff2rigid", line 75, in <module>
    from numpy import *
ImportError: No module named numpy

I have installed latest version of Numpy

我已经安装了最新版本的 Numpy

dev@dev-OptiPlex-780:~$ sudo apt-get install python-numpy
python-numpy is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 75 not upgraded.

I do not understand why this error repeats when i have already installed the latest version of Numpy.

我不明白为什么当我已经安装了最新版本的 Numpy 时会重复出现此错误。

kindly let me know if there is something i am doing it wrong

如果有什么我做错了,请告诉我

回答by Andriy Ivaneyko

Except installing python-numpy library you have to install numpy with pipor easy_install, one of commands below:

除了安装 python-numpy 库外,您还必须使用pipeasy_install安装 numpy ,这是以下命令之一:

# install numpy with pip
pip install numpy

# install numpy with easy_install
easy_install numpy