Centos6.6安装Python3.5笔录
1、CentOS6.6 安装Python3.5 的依赖包
yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
2、下载Python3.5的源码包并编译
wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz
tar -zxvf Python-3.5.1.tgz
cd Python-3.5.1
./configure --prefix=/usr/local --enable-shared
make
make install
ln –s /usr/local/bin/python3 /usr/bin/python3
3、在运行Python之前需要配置库:
echo /usr/local/lib >> /etc/ld.so.conf.d/local.conf
ldconfig
4、运行演示:
python3 --version
Python 3.5.1
5、CentOS6安装pip的方法
wget https://pypi.python.org/packages/source/p/pip/pip-8.1.0.tar.gz#md5=e9c3844db343f47d16040b32ad9072be
注意:wget获取https的时候要加上:--no-check-certificate
tar -zxvf pip-8.1.0.tar.gz#解压文件
cd pip-8.1.0.tar.gz/
python3 setup.py install
OK,这样就安装好pip了。