当我使用 pyenv install 3.6.1 下载某些Python版本时,在运行命令时出现以下错误:
python@ubuntu:~$ pyenv install 3.6.1
Downloading Python-3.6.1.tar.xz...
->https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
error: failed to download Python-3.6.1.tar.xz
BUILD FAILED (Ubuntu 16.04 using python-build 1.2.7-7-g21c75c1)
python@ubuntu:~$pyenv install -v 3.6.1
Downloading Python-3.6.1.tar.xz...
-> https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
curl: (6) Could not resolve host: www.python.org
error: failed to download Python-3.6.1.tar.xz
我发现与此类似的问题:
1。pyenv: BUILD FAILED (Ubuntu 15.04 using python-build 20160509)
2.curl:(6)无法解析主机:www。***
$sudo vi /etc/resolv.conf
# change
nameserver 114.114.114.114
nameserver 8.8.8.8
但是它不起作用,有人可以帮助我吗?