繁体   English   中英

Python3:找不到模块

[英]Python3: Module not found

我已经安装了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时,问题开始了。 顺便说一句,我已经安装了蟒蛇。

您已经确定要使用的python版本确实安装了numpy吗? 你可以用

$ [path_to_your_used_python_version] -m pip show numpy

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

$ [path_to_your_used_python_version] -m pip install numpy

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM