CentOS7默认安装了python2.7.5,当需要使用python3的时候,可以手动下载Python源码后编译安装。
下载python(https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tar.xz)解压下载好的压缩包 sudo mkdir /usr/local/python3 进入解压目录sudo ./configure --prefix=/usr/local/python3 sudo make sudo make install
CentOS 安装easy_install的方法: wget -q http://peak.telecommunity.com/dist/ez_setup.py python ez_setup.py8、CentOS安装python包管理安装工具pip的方法如下: wget --no-check-certificate https://github.com/pypa/pip/archive/1.5.5.tar.gz 注意:wget获取https的时候要加上:--no-check-certificate tar zvxf 1.5.5 #解压文件cd pip-1.5.5/ python3 setup.py install OK,这样就安装好pip了, 下面来安装 requests吧。 pip3 install requests
sudo yum install epel-releasesudo yum install python34
# yum install -y pcre pcre-devel # yum install -y zlib zlib-devel # yum install -y openssl openssl-devel
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz tar zxvf setuptools-0.6c11.tar.gz cd setuptools-0.6c11 python setup.py install