centos6.x下安装Python3.6
默认是root用户下~
wget http://mirrors.sohu.com/python/3.6.2/Python-3.6.2.tgz # 可以换成你想要的版本 tar -zxvf Python-3.6.2.tgz cd Python-3.6.2
--enable-shared 启用共享,方便其他依赖python的一些内置库(比如 mysqlclient) 的资源的正常安装; 不启用可能报以下错误: command 'gcc' failed with exit status 1 在 pyinstaller python打包时,也需要开启 --enable-shared
./configure --prefix=/home/usr/python36/ --enable-shared
make make install cd ../usr/python36/bin/ mkdir -p ~/.pip/ cat << EOF > ~/.pip/pip.conf [global] trusted-host=mirrors.aliyun.com index-url=http://mirrors.aliyun.com/pypi/simple/ EOF 更换软链接 ln -s /home/usr/python36/bin/pip3 /usr/bin/pip36 ln -s /home/usr/python36/bin/python3 /usr/bin/python36