报错curl: (7) Failed to connect to 127.0.0.1 port xxxx: Connection refused

(pyenv install xxx) 报错curl: (7) Failed to connect to 127.0.0.1 port xxxx: Connection refused的解决方法

问题重现截图:
报错curl: (7) Failed to connect to 127.0.0.1 port xxxx: Connection refused_第1张图片
在查看下面的原因和使用解决方法之前,确保自己的pyenv已经安装好了最新的python-build,执行python-build命令看是否有效果
报错curl: (7) Failed to connect to 127.0.0.1 port xxxx: Connection refused_第2张图片

如果没安装好,可以执行pyenv的python-build安装:
cd ~/.pyenv/plugins/python-build && ./install.sh(找到自己pyenv对应的路径)必要时使用sudo ./install.sh
如果python-build已安装可能需要更新代码:
cd ~/.pyenv/plugins/python-build && git pull

curl: (7) Failed to connect to 127.0.0.1 port 8889: Connection refused
原因:
请求被端口8889代理了,这里我是因为用了Qv2ray,改变了系统代理,难怪执行很多网络相关的操作都会报这几个端口连接被拒绝(Connection refused)
报错curl: (7) Failed to connect to 127.0.0.1 port xxxx: Connection refused_第3张图片
解决办法:
关闭系统代理
报错curl: (7) Failed to connect to 127.0.0.1 port xxxx: Connection refused_第4张图片
再次使用命令pyenv install 3.6.8
在这里插入图片描述

你可能感兴趣的:(报错,Linux,linux)