中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

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

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

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

吉木乃县| 洪泽县| 孝义市| 奈曼旗| 五大连池市| 正蓝旗| 浠水县| 丰城市| 方山县| 恩平市| 怀柔区| 太白县| 松溪县| 三都| 岱山县| 宜都市| 黄大仙区| 湖南省| 岐山县| 武川县| 绩溪县| 巩留县| 吕梁市| 辉南县| 治县。| 晋江市| 牡丹江市| 丰城市| 天津市| 沁源县| 青铜峡市| 海原县| 郓城县| 双鸭山市| 桦川县| 呼和浩特市| 巴林左旗| 清涧县| 文登市| 新河县| 徐闻县|