ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed

ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.

1. ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.

guipc@deepnorth01:~/people_counting_api$ sudo pip3 install opencv-python==3.4.0.14
The directory '/home/guipc/.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/guipc/.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 opencv-python==3.4.0.14
  Downloading https://files.pythonhosted.org/packages/8d/12/b4dd4458ac1646278aba8c4ee2e0619796ffd08ed69e8526d6dc34e47242/opencv_python-3.4.0.14-cp35-cp35m-manylinux1_x86_64.whl (24.8MB)
    22% |███████▎                        | 5.6MB 3.8kB/s eta 1:24:36Exception:
Traceback (most recent call last):
  File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/response.py", line 226, in _error_catcher
    yield
  File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/response.py", line 301, in read
    data = self._fp.read(amt)
  File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/filewrapper.py", line 49, in read
    data = self.__fp.read(amt)
  File "/usr/lib/python3.5/http/client.py", line 448, in read
    n = self.readinto(b)
  File "/usr/lib/python3.5/http/client.py", line 488, in readinto
    n = self.fp.readinto(b)
  File "/usr/lib/python3.5/socket.py", line 575, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib/python3.5/ssl.py", line 929, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib/python3.5/ssl.py", line 791, in read
    return self._sslobj.read(len, buffer)
  File "/usr/lib/python3.5/ssl.py", line 575, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 317, in run
    requirement_set.prepare_files(finder)
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 360, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 577, in _prepare_file
    session=self.session, hashes=hashes)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 810, in unpack_url
    hashes=hashes
  File "/usr/lib/python3/dist-packages/pip/download.py", line 649, in unpack_http_url
    hashes)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 871, in _download_http_url
    _download_url(resp, link, content_file, hashes)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 595, in _download_url
    hashes.check_against_chunks(downloaded_chunks)
  File "/usr/lib/python3/dist-packages/pip/utils/hashes.py", line 46, in check_against_chunks
    for chunk in chunks:
  File "/usr/lib/python3/dist-packages/pip/download.py", line 563, in written_chunks
    for chunk in chunks:
  File "/usr/lib/python3/dist-packages/pip/utils/ui.py", line 139, in iter
    for x in it:
  File "/usr/lib/python3/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/python3.5/contextlib.py", line 77, 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 231, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
guipc@deepnorth01:~/people_counting_api$

2. sudo pip3 --default-timeout=1000 install opencv-python==3.4.0.14

pip install 默认超时时间是 15s,在安装的过程中可能会超时。我们在执行命令时,可显式指定超时时间。
–default-timeout=100
–default-timeout=1000

sudo pip3 --default-timeout=100 install opencv-python==3.4.0.14
sudo pip3 --default-timeout=1000 install opencv-python==3.4.0.14
guipc@deepnorth01:~/people_counting_api$ sudo pip3 --default-timeout=1000 install opencv-python==3.4.0.14
[sudo] password for guipc:
The directory '/home/guipc/.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/guipc/.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 opencv-python==3.4.0.14
  Downloading https://files.pythonhosted.org/packages/8d/12/b4dd4458ac1646278aba8c4ee2e0619796ffd08ed69e8526d6dc34e47242/opencv_python-3.4.0.14-cp35-cp35m-manylinux1_x86_64.whl (24.8MB)
    100% |████████████████████████████████| 24.8MB 10kB/s
Collecting numpy>=1.11.1 (from opencv-python==3.4.0.14)
  Downloading https://files.pythonhosted.org/packages/d4/64/7619774f0bd8ef364d46a5df8eb1bc78784cd787324b9624f6793e72f787/numpy-1.17.1-cp35-cp35m-manylinux1_x86_64.whl (20.1MB)
    100% |████████████████████████████████| 20.2MB 14kB/s
Installing collected packages: numpy, opencv-python
  Found existing installation: numpy 1.11.0
    Not uninstalling numpy at /usr/lib/python3/dist-packages, outside environment /usr
Successfully installed numpy-1.17.1 opencv-python-3.4.0.14
You are using pip version 8.1.1, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
guipc@deepnorth01:~/people_counting_api$

3. sudo pip3 install -i https://pypi.douban.com/simple scipy

直接指定下载源。

sudo pip3 install -i https://pypi.douban.com/simple scipy
sudo pip3 install -i https://pypi.douban.com/simple scikit-learn
guipc@deepnorth01:~/people_counting_api$ sudo pip3 install -i https://pypi.douban.com/simple scipy
[sudo] password for guipc:
The directory '/home/guipc/.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 owne           r of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/guipc/.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 th           at directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting scipy
  Downloading https://pypi.doubanio.com/packages/7a/0e/3781e028d62a8422244582abd8f084e6314297026760587c85607f687bf3/scipy-1.3.1-cp35-cp35m-manylinux1_x86_64.whl (25.1MB)
    100% |████████████████████████████████| 25.1MB 61kB/s
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.13.3 in /usr/local/lib/python3.5/dist-packages (from scipy)
Installing collected packages: scipy
Successfully installed scipy-1.3.1
You are using pip version 8.1.1, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
guipc@deepnorth01:~/people_counting_api$
guipc@deepnorth01:~/people_counting_api$ sudo pip3 install -i https://pypi.douban.com/simple scikit-learn
The directory '/home/guipc/.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 owne           r of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/guipc/.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 th           at directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting scikit-learn
  Downloading https://pypi.doubanio.com/packages/1f/af/e3c3cd6f61093830059138624dbd26d938d6da1caeec5aeabe772b916069/scikit_learn-0.21.3-cp35-cp35m-manylinux1_x86_64.whl (6           .6MB)
    100% |████████████████████████████████| 6.6MB 224kB/s
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.11.0 in /usr/local/lib/python3.5/dist-packages (from scikit-learn)
Collecting joblib>=0.11 (from scikit-learn)
  Downloading https://pypi.doubanio.com/packages/cd/c1/50a758e8247561e58cb87305b1e90b171b8c767b15b12a1734001f41d356/joblib-0.13.2-py2.py3-none-any.whl (278kB)
    100% |████████████████████████████████| 286kB 6.2MB/s
Requirement already satisfied (use --upgrade to upgrade): scipy>=0.17.0 in /usr/local/lib/python3.5/dist-packages (from scikit-learn)
Installing collected packages: joblib, scikit-learn
Successfully installed joblib-0.13.2 scikit-learn-0.21.3
You are using pip version 8.1.1, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
guipc@deepnorth01:~/people_counting_api$

4. 开源软件镜像

中国科学技术大学开源软件镜像
http://mirrors.ustc.edu.cn/

清华大学开源软件镜像
https://mirrors.tuna.tsinghua.edu.cn/

网易开源镜像
http://mirrors.163.com/

阿里巴巴开源镜像
https://opsx.alibaba.com/mirror

上一篇:ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed


下一篇:build (1) build.js