Python numpy или scipy ошибка

Я хочу работать в Python. Когда я импортирую scipy или numpy, он показывает эти ошибки:

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 "<stdin>", line 1, in <module>
ImportError: No module named numpy
>>> 

Но когда я использую, это управляет:

sudo pip install numpy scipy

Это показывает:

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).

Что мне делать?

0
задан 15 May 2018 в 07:39

1 ответ

У Вас есть Anaconda Python и не система версия Python. Поскольку Вы используете Anaconda, Ваш пакет должен быть установлен с помощью conda или Анаконда pip версия. Используя base среда установки Анаконды по умолчанию, Numpy и Scipy уже установлена, если нет:

conda install numpy scipy
0
ответ дан 29 October 2019 в 07:59

Другие вопросы по тегам:

Похожие вопросы: