编译安装Python3
# 下载
# wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
wget http://mirrors.sohu.com/python/3.6.4/Python-3.6.4.tgz
# 解压
tar -xavf Python-3.6.4.tgz
cd Python-3.6.4
# 编译安装
# ./configure --help查看编译参数
# 默认安装在'/usr/local/bin','/usr/local/lib' etc
# 可以通过参数指定如:--prefix=/usr/local/python3
./configure
make
# 把安装日志保存下来
make install > install.log
卸载Python3
通过安装日志可知Python3被安装在如下目录了
/usr/local/lib/python3.6
/usr/local/bin/2to3-3.6 to
/usr/local/bin/pyvenv-3.6
/usr/local/bin/pydoc3.6
/usr/local/bin/idle3.6
# 删除上述文件
rm -rf /usr/local/lib/python3.6
rm -rf /usr/local/bin/2to3-3.6 to
rm -rf /usr/local/bin/pyvenv-3.6
rm -rf /usr/local/bin/pydoc3.6
rm -rf /usr/local/bin/idle3.6
原文地址:https://www.cnblogs.com/okokabcd/p/8641469.html
时间: 2024-11-01 17:24:28