Home  >  Article  >  Backend Development  >  Which version of python should be installed?

Which version of python should be installed?

anonymity
anonymityOriginal
2019-06-18 10:33:0811787browse

The version of Python has been constantly updated. Here are two recommended versions: 2.7 for the Python2.X series; 3.5 for the Python3.X series

Which version of python should be installed?

##windows :Install 2.7 and 3.5 at the same time

1. Download the installation package

https://www.python.org/downloads/

2. Installation

Default installation path: C:\python27

3. Configure environment variables

[Right-click computer]--"[Properties]--"[Advanced system settings]--"[ Advanced】--》[Environment Variables]--》[Find the line with the variable name Path in the second content box, double-click] --> [The Python installation directory is appended to the variable value, separated by;]

For example: original value; C:\python27, remember to have a semicolon in front

linux: Change to 2.7 into 3.5

yum -y install python-devel openssl openssl-devel gcc sqlite sqlite-devel mysql-devel libxml2-devel libxslt-devel
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz
tar xf Python-3.5.2.tar.xz
./configure --prefix=/usr/local/python3.5 --with-threads --enable-shared
make && make altinstall
mv /usr/bin/pip /usr/bin/pip_old
mv /usr/bin/easy_install /usr/bin/easy_install_old
mv /usr/bin/python /usr/bin/python_old
ln -s /usr/local/python3.5/lib/libpython3.5m.so /usr/lib
ln -s /usr/local/python3.5/lib/libpython3.5m.so.1.0 /usr/lib
ln -s /usr/local/python3.5/lib/libpython3.5m.so /usr/lib64
ln -s /usr/local/python3.5/lib/libpython3.5m.so.1.0 /usr/lib64
ln -s /usr/local/python3.5/bin/python3.5 /usr/bin/python
ln -s /usr/local/python3.5/bin/easy_install-3.5 /usr/bin/easy_install
ln -s /usr/local/python3.5/bin/pip3.5 /usr/bin/pip
/sbin/ldconfig -v
python

The above is the detailed content of Which version of python should be installed?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn