Python is a cross-platform, portable programming language that can be installed on Windows, Linux, and Mac OS X systems.

Once installed, you will be given the Python interpreter environment, and you can use the terminal to type Python commands to see if Python and the Python version are available locally. One thing to note here is that an error is reported if the Python installation directory is not added to the environment variable (Python is not an internal or external command, nor is it an executable). You need to add the Python installation environment to the environment variable.

Python download

You can download Python version 3 from www.python.org/ to www.python.org/doc/. You can also download Python version 2. People are going to be torn between python2 and Python3. Right?

Actually here does not need to tangle, official explanation here: wiki.python.org/moin/Python… “, basically saying that Python 3 is the present and future of the language, and Python 2 must become the past.

Install Python on Windows

Go to the official website to download according to the package, the next step is basically ok.

 

Check this option during installation. Environment variables are added directly.

Once installed, you can verify it. On the CMD screen, type Python. If you can see the following interface, the installation and success.

Install Python in Linux

Most Linux distributions have Python installed by default, but Python 2 is installed by default. If you want to install Python version 3, you need to install it yourself. It is best to take a snapshot in the VIRTUAL machine and download it from the official website before installation. www.python.org/downloads/s…

Next go to your Linux system and unzip the downloaded files

Dependencies that might be used by installing python3.6

yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel yum -y install gcc* Go to the Python website to find the download path, Download wGET with wget [https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz] (https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz) Decompression TGZ package tar ZXVF Python - 3.6.4 radar echoes captured. The below TGZ move Python to/usr/local Python - 3.6.4 radar echoes captured mv/usr/local to delete the old version of Python rely on ll/usr/bin | grep Python rm -rf /usr/bin/python Go to the Python directory CD /usr/local/python-3.6.4 / config. /configure --prefix=/usr/local/python3.6 Make install delete the old soft link, Create a new soft link to the latest Python rm -rf /usr/bin/python ln -s /usr/local/bin/python3.6 /usr/bin/python ln -s / usr/local/bin/python3.6 / bin/pip3.6 / usr/bin/pip3 python -vCopy the code

Problems that might arise

Zipimport. ZipImportError: can ‘t decompress data because of lack of zlib related kit, know the problem, so we only need to install the relevant depend on the package

yum -y install zlib*

Install Python on a MAC

MAC systems typically ship with Python version 2.7. To install Python 3, go to the official website and download it. I won’t go into the details here.