91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

PIP安裝docker-compose超時問題解決方案

發布時間:2020-10-07 21:51:13 來源:腳本之家 閱讀:513 作者:薛定諤的貓! 欄目:開發技術

1:安裝命令

pip install docker-compose

異常信息

socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 188, in _main
status = self.run(options, args)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 185, in wrapper
return func(self, options, args)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 333, in run
reqs, check_supported_wheels=not options.target_dir
File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/legacy/resolver.py", line 179, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/legacy/resolver.py", line 362, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/legacy/resolver.py", line 314, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 469, in prepare_linked_requirement
hashes=hashes,
File "/usr/local/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 259, in unpack_url
hashes=hashes,
File "/usr/local/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 130, in get_http_url
link, downloader, temp_dir.path, hashes
File "/usr/local/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 281, in _download_http_url
for chunk in download.chunks:
File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/progress_bars.py", line 166, in iter
for x in it:
File "/usr/local/lib/python3.6/site-packages/pip/_internal/network/utils.py", line 39, in response_chunks
decode_content=False,
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 564, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 529, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/usr/lib64/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 430, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

網上有網友說加上超時時間,但并沒有解決我這個問題。

pip --default-timeout=100 install docker-compose

這個應該是沒有翻墻導致下載超時。所以需要修改pip 的源

按照網上例子,臨時修改了pip的源,再次執行安裝命令,也沒有解決我的問題

[root@localhost bin]# pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple/

后來又看到一篇博客,這種方式解決了我的問題,修改源借鑒的是https://blog.csdn.net/h206140873/article/details/103858931 博客。

1:在根目錄下創建pip文件夾(我是使用的root用戶)

mkdir ~/.pip

2:在 .pip目錄中創建 pip.conf文件

touch pip.conf

3:編輯 pip.conf 文件,添加如下兩行內容

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

再次執行 pip --default-timeout=100 install docker-compose 命令,安裝成功。并且下載速度很快

注:pip國內的一些鏡像

阿里云 http://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/
中國科學技術大學 http://pypi.mirrors.ustc.edu.cn/simple/

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持億速云。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

佛学| 东莞市| 丰镇市| 靖州| 镇远县| 长治市| 时尚| 扶沟县| 方正县| 巴林右旗| 洞口县| 台安县| 顺义区| 北安市| 隆子县| 和平区| 灌云县| 天全县| 德令哈市| 成安县| 扎兰屯市| 胶州市| 陕西省| 赣榆县| 清镇市| 浪卡子县| 中宁县| 葵青区| 蓝田县| 三穗县| 六枝特区| 荔浦县| 政和县| 永嘉县| 营口市| 阿合奇县| 江川县| 莆田市| 乌鲁木齐市| 栾川县| 安泽县|