佳木斯湛栽影视文化发展公司

主頁 > 知識(shí)庫 > PIP安裝docker-compose超時(shí)問題解決方案

PIP安裝docker-compose超時(shí)問題解決方案

熱門標(biāo)簽:美圖手機(jī) 檢查注冊(cè)表項(xiàng) 使用U盤裝系統(tǒng) 網(wǎng)站建設(shè) 百度競(jìng)價(jià)點(diǎn)擊價(jià)格的計(jì)算公式 硅谷的囚徒呼叫中心 智能手機(jī) 阿里云

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.

網(wǎng)上有網(wǎng)友說加上超時(shí)時(shí)間,但并沒有解決我這個(gè)問題。

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

這個(gè)應(yīng)該是沒有翻墻導(dǎo)致下載超時(shí)。所以需要修改pip 的源

按照網(wǎng)上例子,臨時(shí)修改了pip的源,再次執(zhí)行安裝命令,也沒有解決我的問題

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

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

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

mkdir ~/.pip

2:在 .pip目錄中創(chuàng)建 pip.conf文件

touch pip.conf

3:編輯 pip.conf 文件,添加如下兩行內(nèi)容

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

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

注:pip國內(nèi)的一些鏡像

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

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

標(biāo)簽:懷化 通遼 煙臺(tái) 賀州 黃山 湘潭 山南 湖北

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《PIP安裝docker-compose超時(shí)問題解決方案》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    洪江市| 温州市| 寻甸| 蕲春县| 永州市| 封开县| 三穗县| 亚东县| 重庆市| 博白县| 平顶山市| 丰台区| 永新县| 罗甸县| 阿拉善盟| 三亚市| 北辰区| 于都县| 始兴县| 安乡县| 鹤山市| 六枝特区| 台北县| 叶城县| 台中市| 文山县| 嘉黎县| 楚雄市| 新蔡县| 巴彦县| 轮台县| 西林县| 黄石市| 高碑店市| 汉中市| 墨竹工卡县| 广州市| 奎屯市| 安丘市| 蕲春县| 临沧市|