首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >python或枕错误

问python或枕错误
EN

Ask Ubuntu用户
提问于 2018-05-15 14:37:42
回答 1查看 3.2K关注 0票数 0

我想在蟒蛇里工作。当我导入scipy或numpy时,它会显示以下错误:

代码语言:javascript
复制
saikat@saikat:~/Downloads/Python-2.7.15$ python
Python 2.7.14 |Anaconda, Inc.| (default, Dec  7 2017, 17:05:42) 
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named numpy
>>> 

但当我使用这些命令时:

代码语言:javascript
复制
sudo pip install numpy scipy

它显示:

代码语言:javascript
复制
saikat@saikat:~/Downloads/Python-2.7.15$ sudo pip install numpy scipy
The directory '/home/saikat/.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/saikat/.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/python2.7/dist-packages/numpy-1.14.3-py2.7-linux-x86_64.egg (1.14.3)
Requirement already satisfied: scipy in /usr/local/lib/python2.7/dist-packages (1.1.0).

我该怎么办?

EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2018-08-25 20:44:45

您有Anaconda,而不是system版本。因为您使用Anaconda,所以您的包应该使用conda或Anaconda pip版本安装。使用默认Anaconda安装的base环境,Numpy和Scipy已经安装,如果没有安装:

代码语言:javascript
复制
conda install numpy scipy
票数 1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1036565

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档