wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
tar -xvf Python-3.6.5.tgz
cd Python-3.6.5/
./configure
make && make install
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.6 2
update-alternatives --config python3
替换版本之后 pip3 install 时会提示错误subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.
, 重点关注lsb_release.py
这个模块
我们将python3.5中的lsb_release.py
复制到python3.6中
root@ubuntu:~# find / -name 'lsb_release.py'
/usr/lib/python2.7/dist-packages/lsb_release.py
/usr/lib/python3/dist-packages/lsb_release.py
/usr/share/pyshared/lsb_release.py
root@ubuntu:~# cp /usr/lib/python3/dist-packages/lsb_release.py /usr/local/lib/python3.6/
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。