python numpy ou scipy error

0

Eu quero trabalhar em python. Quando eu importo scipy ou numpy, ele mostra esses erros:

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

Mas quando eu uso este comando:

sudo pip install numpy scipy

Mostra:

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

O que devo fazer?

    
por Saikat Pal 15.05.2018 / 16:37

1 resposta

0

Você tem o Anaconda Python e não a versão do sistema Python. Como você usa o Anaconda, seu pacote deve ser instalado usando conda ou Anaconda pip version. Usando o ambiente base da instalação padrão do Anaconda, o Numpy e o Scipy já estão instalados, se não:

conda install numpy scipy
    
por cosmoscalibur 25.08.2018 / 22:44