pycharm ubuntu系统 python3 ImportError: No module named numpy 问题解决

pycharm ubuntu系统 python3 ImportError: No module named numpy 问题解决

在安装了pycharm,运行程序是出现了ImportError:No module named numpy(包括其他包也是)
首先,需要看下在命令行能不能import numpy
先CTRL+ALT+T打开终端
然后输入import numpy(也可以是其他包)

python3 #打开python终端
import numpy

这里需要注意的是,如果你用的是python3,需要输入python3,否则你的包可能是安装在了python2下。如果此时发现没有安装,需要在python3下安装。

sudo apt-get install python3-pip#安装pip
pip3 install numpy #或者其他包,注意这里需要用pip3

然后查看python3的安装路径,打开终端输入

which python3 #查看python3的安装路径

都安装完成之后,打开pycharm-File-Settings-project-project Interpreter,project Interpreter路径填写为which python3命令得到的路径,这个时候问题就解决了,亲测有效。

你可能感兴趣的:(问题解决)