pip代理设置:
设置文件路径:C:\Users\user_name\pip\pip.ini (没有就手动创建)
设置内容:
[global]
proxy = IP:端口号
配置错误可能出现错误:
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:852)'),)': /simple/easyocr/
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:852)'),)': /simple/easyocr/
Could not fetch URL https://pypi.org/simple/easyocr/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/easyocr/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:852)'),)) - skipping
socket 代理,实测速度更快:
pip install pysocks
pip install packet --proxy socks5://ip:port
conda 代理设置:
设置文件路径:C:\Users\user_name\.condarc
设置内容:
proxy_servers:
http: IP:端口号
https: IP:端口号
socket 设置:
proxy_servers:
http: socks5://IP:端口号
https: socks5://IP:端口号
设置不对会出现错误:
conda create -n torch_nightly_python3.8 python=3.8
File "D:\ProgramData\Anaconda3\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "D:\ProgramData\Anaconda3\lib\ssl.py", line 997, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname