02-Python download and installation _ Python programming path, 02-python_python
The original Article is published on the TOPEX blog www.susmote.com.
I have told you about the background of python and the advantages and disadvantages of Python. I believe that many people have already learned whether to choose to learn Python, if you are interested, you can view some official Python documents or buy a book on your own. If you are not interested yet, do not give up, I tried to read a few more courses. It would be normal if I was not interested, and Python was not the best language.
Download Python
Python download is very simple, directly go to the official website https://www.python.org/
Click Downloads
There are two versions for us to choose from: Python3 and Python2. We choose to download the stable version of Python3, which is directly displayed on windows, if you want to download other versions, please select the system. The official website is clear and I will not explain it too much.
Only source code files are available on Linux. download them.
Of course, you may need to download a specific version of Python. In this case, you only need to scroll down.
At the same time, there are detailed release times for each version. If you are interested, you can learn the following:
Python scientific computing release
Anaconda:
Anaconda refers to an open-source Python release, which contains more than 180 scientific packages and their dependencies such as conda and Python. [1] Because Anaconda contains a large number of scientific packages, the downloaded files are relatively large (about 515 MB). If you only need some packages, or you need to save bandwidth or storage space, you can also use the mini-conda release (only including conda and Python ).
Python Installation
Python can run on all mainstream platforms, such as Linux, windows, and Mac OS X. Since Mac OS X is not commonly used, the installation courses are mainly divided into Linux and Windows platforms.
Linux
Linux has a Python interpreter.
Only the version is 2.6. to support future development, we recommend that you use the stable version of python3.
Python installation in Linux can only be compiled and installed through source code
1. First, install the dependency environment. We can install it through yum.
# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
2. Create a python Directory, which is generally created in/usr/local/python3.
# mkdir -p /usr/local/python3
3. Move the downloaded python installation package to this directory.
# mv /root/Python-3.6.5rc1.tgz /usr/local/python3
4. decompress the python installation package
# tar -zxvf Python-3.6.5rc1.tgz
5. Go to the decompressed directory for compilation and Installation
# cd Python-3.6.5# ./configure --prefix=/usr/local/python3
Make
# make
Make install
# make install
6. Establish a soft connection
# ln -s /usr/local/python3/bin/python3 /usr/bin/python3
7. Configure Environment Variables
# vim ~/.bash_profile# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/bin:/usr/local/python3/binexport PATH
Remember to save and exit after modification, and then execute the following command
# source ~/.bash_profile
8. Check whether the configuration is successful.
# Python -- vertion or python3 -- version
Now that python is fully installed, you can install pip and other python package managers.
Windows
The installation in windows is very simple. After downloading the executable installation package, click Install directly. Of course there are many types in windows.
I am not going to do more here.
After installation, You need to configure environment variables to directly run the python interpreter on the command line.
Next I will focus on the configuration of python environment variables in windowns
Right-click this computer and choose Properties
Select advanced system settings
Select Environment Variables
Select to edit the path in the system variable
Add the python installation directory.
Note that each path is separated by a semicolon.
# D:\Users\smarter\Anaconda3