CentOS7 installs python2.7.5 by default. When you need to use python3, you can manually download the Python source code and compile and install it.
Download python(https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tar.xz)Unzip the downloaded compressed package
sudo mkdir /usr/local/python3
Enter the decompression directory sudo./configure --prefix=/usr/local/python3
sudo make
sudo make install
CentOS installation easy_Install method:
wget -q http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py8, CentOS install the python package management installation tool pip method as follows:
wget --no-check-certificate https://github.com/pypa/pip/archive/1.5.5.tar.gz
Note: When wget gets https, add:--no-check-certificate
tar zvxf 1.5.5 #Unzip the file cd pip-1.5.5/
python3 setup.py install
OK, so pip is installed,
Now let's install 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
Recommended Posts