在配置了代理之后,pip intall 命令就不好用了,会提示下面的错误:
Looking in indexes: Simple Index WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1002)'))': /pypi/simple/request/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1002)'))': /pypi/simple/request/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1002)'))': /pypi/simple/request/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1002)'))': /pypi/simple/request/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1002)'))': /pypi/simple/request/ Could not fetch URL https://mirrors.aliyun.com/pypi/simple/request/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='mirrors.aliyun.com', port=443): Max retries exceeded with url: /pypi/simple/request/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1002)'))) - skipping ERROR: Could not find a version that satisfies the requirement request (from versions: none) ERROR: No matching distribution found for request Note: you may need to restart the kernel to use updated packages.
不管是阿里源还是国外的源都有这个问题。
解决办法,指定一下代理参数:
pip install request --proxy=http://127.0.0.1:7890