【问题记录】pip 安装报错 Failed to establish a new connection
生活随笔
收集整理的這篇文章主要介紹了
【问题记录】pip 安装报错 Failed to establish a new connection
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
問題:
在安裝 mmcv 的時候使用 pip install mmcv 報錯如下:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fee6df12f60>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/mmcv/解決方案:
輸入如下代碼:
sudo echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null Collecting mmcvDownloading mmcv-1.6.1.tar.gz (563 kB)|████████████████████████████████| 563 kB 986 kB/s Collecting addictDownloading addict-2.4.0-py3-none-any.whl (3.8 kB) Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (from mmcv) (1.19.5) Requirement already satisfied: packaging in /usr/local/lib/python3.8/dist-packages (from mmcv) (20.9) Requirement already satisfied: Pillow in /usr/local/lib/python3.8/dist-packages (from mmcv) (8.1.2) Requirement already satisfied: pyyaml in /usr/local/lib/python3.8/dist-packages (from mmcv) (5.4.1) Collecting yapfDownloading yapf-0.32.0-py2.py3-none-any.whl (190 kB)|████████████████████████████████| 190 kB 31.8 MB/s Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from packaging->mmcv) (2.4.7) Building wheels for collected packages: mmcvBuilding wheel for mmcv (setup.py) ... doneCreated wheel for mmcv: filename=mmcv-1.6.1-py2.py3-none-any.whl size=860277 sha256=4f25550e01acc52694ddc0d12451bd57a9b2dd7f78f3cc679e54687323517eebStored in directory: /root/.cache/pip/wheels/e3/ac/32/75552e05d1964b2123f074fe3e87c890e9ac83bc2d2c5b59d6 Successfully built mmcv Installing collected packages: yapf, addict, mmcv Successfully installed addict-2.4.0 mmcv-1.6.1 yapf-0.32.0總結(jié)
以上是生活随笔為你收集整理的【问题记录】pip 安装报错 Failed to establish a new connection的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 禅道项目管理软件测试功能模块,禅道使用分
- 下一篇: oppo android多大内存,OPP