问题1:WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1124)’))’: /simple/mitmproxy/
pip安装应用时报错pip3 install mitmproxy
- 报错信息:
(venv) D:\PycharmProjects\pythonProject>pip3 install mitmproxy
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] w
rong version number (_ssl.c:1124)'))': /simple/mitmproxy/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] w
rong version number (_ssl.c:1124)'))': /simple/mitmproxy/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] w
rong version number (_ssl.c:1124)'))': /simple/mitmproxy/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] w
rong version number (_ssl.c:1124)'))': /simple/mitmproxy/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] w
rong version number (_ssl.c:1124)'))': /simple/mitmproxy/
Could not fetch URL https://pypi.org/simple/mitmproxy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries
exceeded with url: /simple/mitmproxy/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1124)'))) - skipping
ERROR: Could not find a version that satisfies the requirement mitmproxy
ERROR: No matching distribution found for mitmproxy
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries excee
ded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1124)'))) - skipping
(venv) D:\PycharmProjects\pythonProject>
(venv) D:\PycharmProjects\pythonProject>
- 方法1:在C盘目录
C:\Users\admin\AppData\Roaming\pip
文件夹创建pip.ini
文件,同時在pip.ini
文件中输入一下内容即可,在此文件中修改了pip下载源,同时指定新的下载源和域名。
[global]
index-url = http://mirrors.aliyun.com/pypi/simple
trusted-host = http://mirrors.aliyun.com
- 方法2:在
pip install xxx
指令后边添加-i http://pypi.douban.com/simple --trusted-host pypi.douban.com
(其中的xxx是你需要下载的包)
(venv) D:\PycharmProjects\pythonProject>pip install pyserial -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple
Collecting pyserial
Downloading http://pypi.doubanio.com/packages/07/bc/587a445451b253b285629263eb51c2d8e9bcea4fc97826266d186f96f558/pyserial-3.5-py2.py3-none-any.whl (90 kB)
|████████████████████████████████| 90 kB 990 kB/s
Installing collected packages: pyserial
Successfully installed pyserial-3.5
WARNING: You are using pip version 20.3.1; however, version 21.0.1 is available.
You should consider upgrading via the 'd:\pycharmprojects\pythonproject\venv\scripts\python.exe -m pip install --upgrade pip' command.
(venv) D:\PycharmProjects\pythonProject>
附上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/
使用方法:在后面直接 -i 加 url
pip install 包名.whl -i http://pypi.mirrors.ustc.edu.cn/simple -trusted-host pypi.mirrors.ustc.edu.cn
参考:
https://blog.youkuaiyun.com/lsf_007/article/details/87931823
https://blog.youkuaiyun.com/weixin_41010294/article/details/103672386
https://www.it610.com/article/1280565051354267648.htm
问题2:WARNING: You are using pip version 20.3.1; however, version 21.0.1 is available.
解决:
(venv) D:\PycharmProjects\pythonProject>python -m pip install --upgrade pip --trusted-host mirrors.aliyun.com
Looking in indexes: http://mirrors.aliyun.com/pypi/simple
Requirement already satisfied: pip in d:\pycharmprojects\pythonproject\venv\lib\site-packages (20.3.1)
Collecting pip
Downloading http://mirrors.aliyun.com/pypi/packages/fe/ef/60d7ba03b5c442309ef42e7d69959f73aacccd0d86008362a681c4698e83/pip-21.0.1-py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 6.8 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.3.1
Uninstalling pip-20.3.1:
Successfully uninstalled pip-20.3.1
Successfully installed pip-21.0.1
(venv) D:\PycharmProjects\pythonProject>