python - ImportError:没有名为“numpy”的模块,但它就在那里!蟒蛇3.5
问题描述
我在这里想念什么?有人可以在这里启发我吗?
第 1 步。我正在尝试安装 numpy。
aerin@aerin-HP-Z230-Tower-Workstation:~$ sudo pip install numpy
> The directory '/home/aerin/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been
> disabled. Please check the permissions and owner of that directory. If
> executing pip with sudo, you may want sudo's -H flag.
> The directory '/home/aerin/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled.
> check the permissions and owner of that directory. If executing pip
> with sudo, you may want sudo's -H flag.
> Requirement already satisfied: numpy in /usr/local/lib/python3.5/dist-packages
> You are using pip version 9.0.3, however version 10.0.1 is available.
> You should consider upgrading via the 'pip install --upgrade pip' command.
第 2 步。好的。它说它在/usr/local/lib/python3.5/dist-packages
. 所以让我们使用 numpy.
aerin@aerin-HP-Z230-Tower-Workstation:~$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'
第 3 步。你在开玩笑吗?让我们看看它在哪里导入包。
>import site; site.getsitepackages()
['/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.5/dist-packages']
你说它在那里,但它给了我一个 ImportError!如果有人提示我在哪里看,我将不胜感激。谢谢!
解决方案
不确定,但我认为您应该尝试:
sudo pip3 install numpy
如果这不起作用,请尝试为 python2&3 重新安装 numpy
推荐阅读
- c++ - * function() 和 function() 的区别
- postgresql - Postgres函数错误:未终止的美元报价
- php - $_GET 值到 if else 语句中
- oracle - 如何在两个 Oracle RDS 实例之间创建数据库链接
- bash - Bash:printf中特殊字符的文字字符串
- r - 基于两个变量但有一个截止点的排序数据
- java - CSV 解析器 java.lang.ArrayIndexOutOfBoundsException
- sql-server - 机器人框架 - 尝试连接到云中的 SQL 服务器时出错 (Azure)
- android-studio - Android Studio 运行按钮故障
- electron - 是否可以为电子生成器运行后期构建脚本?