1.问题:安装依赖库时报网络错误
(base) [root@VM-4-12-centos clash]# pip install gunicorn
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/gunicorn/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/gunicorn/
解决方案:尝试修改环境变量
export http_proxy=''
export https_proxy=''
2.请求openapi接口一直报错:
^XRetrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 16.0 seconds as it raised APIConnectionError: Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer'))).
解决方案:有可能是clash代理出问题,通过clash日志判断,如果出现:
WARN[0067] [TCP] dial ⚓️其他流量 (match Match/) 127.0.0.1:60624 --> api.openai.com:443 error: dc.xmrthnode.com:42031 connect error: dial tcp4 60.18.196.133:42031: connect: connection refused
说明是代理问题,这个时候可以尝试切换代理Rule Mode,浏览器中输入:http://yacd.haishan.me/#/proxies
修改代理后重试