Python3:找不到模块

时间:2018-10-02 09:35:00

标签: python-3.x pip

我已经安装了numpy,但Shell表示未安装。我安装了多个python3版本。我知道它必须做点什么才能指向正确的路径,但是我不知道该怎么做。 python3和pip3都指向python 3.6。我不明白这可能是什么问题?

这些可能会有所帮助:

$ where python3                  
/home/subtleseeker/miniconda3/bin/python3
/usr/bin/python3
/usr/bin/python3

$ whereis python3
python3: /usr/bin/python3.6m 
/usr/bin/python3.6-config 
/usr/bin/python3 
/usr/bin/python3.6m-config 
/usr/bin/python3.6 
/usr/lib/x86_64-linux-gnu/python3.6 
/usr/lib/python3.7 
/usr/lib/python3 
/usr/lib/python3.6 
/etc/python3 
/etc/python3.6 
/usr/local/bin/python3.4m-config 
/usr/local/bin/python3.4 
/usr/local/bin/python3.4m 
/usr/local/lib/python3.4 
/usr/local/lib/python3.6 
/usr/include/python3.6m 
/usr/include/python3.6 
/usr/share/python3 
/home/subtleseeker/miniconda3/bin/python3.6m 
/home/subtleseeker/miniconda3/bin/python3.6-config 
/home/subtleseeker/miniconda3/bin/python3 
/home/subtleseeker/miniconda3/bin/python3.6m-
/home/subtleseeker/miniconda3/bin/
/usr/share/man/man1/python3.1.gz

$ pip3 --version
pip 18.0 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)

$ python3 --version
Python 3.6.5 :: Anaconda, Inc.

>>> import sys
>>> print(sys.path)
['', '/home/subtleseeker/miniconda3/lib/python36.zip', '/home/subtleseeker/miniconda3/lib/python3.6', '/home/subtleseeker/miniconda3/lib/python3.6/lib-dynload', '/home/subtleseeker/.local/lib/python3.6/site-packages', '/home/subtleseeker/miniconda3/lib/python3.6/site-packages']

当我安装miniconda时,问题开始了。顺便说一句,我已经安装了蟒蛇。

1 个答案:

答案 0 :(得分:2)

您是否已确定您使用的python版本确实安装了numpy?您可以使用

$ [path_to_your_used_python_version] -m pip show numpy

如果尚未安装,则可以使用

进行安装
$ [path_to_your_used_python_version] -m pip install numpy