Como remover esse erro ao instalar o numpy no Ubuntu?

1

Estou recebendo essa exceção ao tentar instalar o numpy. Eu tentei ambos chamando diretamente pip (comando: pip install numpy) e também pelo sudo. Por favor ajude a resolver isso:

    fareha@fareha-Inspiron-5537:~$ sudo pip install numpy scipy
    [sudo] password for fareha: 
    The directory '/home/fareha/.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/fareha/.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.
    Collecting numpy
    Downloading numpy-1.14.2-cp27-cp27mu-manylinux1_x86_64.whl (12.1MB)
76% |████████████████████████▍       | 9.3MB 3.2kB/s eta 0:14:49Exception:
    Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
    File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run
requirement_set.prepare_files(finder)
    File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files
ignore_dependencies=self.ignore_dependencies))
    File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 577, in _prepare_file
session=self.session, hashes=hashes)
     File "/usr/lib/python2.7/dist-packages/pip/download.py", line 810, in unpack_url
hashes=hashes
     File "/usr/lib/python2.7/dist-packages/pip/download.py", line 649, in unpack_http_url
hashes)
     File "/usr/lib/python2.7/dist-packages/pip/download.py", line 871, in _download_http_url
_download_url(resp, link, content_file, hashes)
    File "/usr/lib/python2.7/dist-packages/pip/download.py", line 595, in _download_url
hashes.check_against_chunks(downloaded_chunks)
   File "/usr/lib/python2.7/dist-packages/pip/utils/hashes.py", line 46, in check_against_chunks
for chunk in chunks:
    File "/usr/lib/python2.7/dist-packages/pip/download.py", line 563, in written_chunks
for chunk in chunks:
    File "/usr/lib/python2.7/dist-packages/pip/utils/ui.py", line 139, in iter
for x in it:
    File "/usr/lib/python2.7/dist-packages/pip/download.py", line 552, in resp_read
decode_content=False):
    File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/response.py", line 344, in stream
data = self.read(amt=amt, decode_content=decode_content)
     File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/response.py", line 311, in read
flush_decoder = True
     File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
     File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/response.py", line 240, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
     ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.
    
por Swan 03.04.2018 / 21:33

1 resposta

0

O Numpy e o Scipy for Python 2.x podem ser instalados a partir dos repositórios padrão em todas as versões atualmente suportadas do Ubuntu com o seguinte comando:

sudo apt install python-numpy python-scipy  

Os pacotes correspondentes para o Python 3.x são python3-numpy e python3-scipy.

    
por karel 04.04.2018 / 18:14