删除系统 Python 引发的惨案_码小辫的技术博客_51CTO博客
从官网下载
tar -zxvf xxxxx
创建安装目录
$ sudo mkdir -p /usr/local/python3
配置、编译、安装
$ ./configure --prefix=/usr/local/python3 --enable-optimizations
make
sudo make install
$ ln -s /usr/local/python3/bin/python3.7 /usr/bin/python37
添加 pip3 的软链接(这样pip3就是python3.7专用的,也可以起名为 pip37,不影响python3.5的pip3)$ ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip37
安装pip
安装setuptools
下载
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26
解压
tar xvf setuptools-19.6.tar.gz
重新编译安装
cd setuptools-19.6/
sudo python37 setup.py build
sudo python37 setup.py install
安装pip
下载
wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz#md5=3a73c4188f8dbad6a1e6f6d44d117eeb
解压
tar xvf pip-8.0.2.tar.gz
编译&安装
sudo python37 setup.py build
sudo python37 setup.py install
apt-get update 问题
解决依赖报错
https://www.jianshu.com/p/c49206bb8d55
apt-get purge 卸载之前报错的
sudo apt-get -f install
zlib 问题
zlib和zlib-devel
https://blog.51cto.com/xxaqustc/1166371
openssl
_ctypes 报错
Ubuntu16.04 No module named _sqlite3 解决方案