root@23c943ed55e4:/workspace# pip install opencv-python
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting opencv-python
Downloading https://files.pythonhosted.org/packages/77/30/36c3f0644fa9f42d92f079b972e990a5874c1fc2b2c0e9656eb88bb8d6dc/opencv_python-4.1.0.25-cp27-cp27mu-manylinux1_x86_64.whl (26.6MB)
| | 358kB 9.5kB/s eta 0:45:56ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/base_command.py", line 178, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/install.py", line 352, in run
resolver.resolve(requirement_set)
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/resolve.py", line 131, in resolve
self._resolve_one(requirement_set, req)
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/resolve.py", line 294, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/resolve.py", line 242, in _get_abstract_dist_for
self.require_hashes
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/operations/prepare.py", line 347, in prepare_linked_requirement
progress_bar=self.progress_bar
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/download.py", line 886, in unpack_url
progress_bar=progress_bar
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/download.py", line 746, in unpack_http_url
progress_bar)
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/download.py", line 954, in _download_http_url
_download_url(resp, link, content_file, hashes, progress_bar)
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/download.py", line 683, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/utils/hashes.py", line 62, in check_against_chunks
for chunk in chunks:
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/download.py", line 651, in written_chunks
for chunk in chunks:
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/utils/ui.py", line 156, in iter
for x in it:
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/download.py", line 640, in resp_read
decode_content=False):
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/response.py", line 494, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/response.py", line 459, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/response.py", line 374, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
root@23c943ed55e4:/workspace# pip install --index https://pypi.mirrors.ustc.edu.cn/simple/ opencv-python==3.1.0.3
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/
Collecting opencv-contrib-python
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b6/ed/534f97af6a8940da5f4076b530f07d1d660ba1aeb25dade588f96b065af5/opencv_contrib_python-4.1.0.25-cp27-cp27mu-manylinux1_x86_64.whl (32.6MB)
|################################| 32.6MB 3.2MB/s
Requirement already satisfied: numpy>=1.11.1 in /usr/local/lib/python2.7/dist-packages (from opencv-python==3.1.0.3) (1.14.2)
Installing collected packages: opencv-contrib-python
Successfully installed opencv-contrib-python-3.1.0.3
root@23c943ed55e4:/workspace# python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>>
pip install --index https://pypi.mirrors.ustc.edu.cn/simple/ pkgsName