Article From:https://www.cnblogs.com/louis0815/p/9061872.html

Install Python

windows:

1
2
3
4
5
6
7
1、Download the installation package
    https://www.python.org/downloads/
2、install
    Default installation path: C:\python27
3、Configuring environment variables
    【Right key computer]--》【Property]--》【Advanced system settings]--》【Senior]--》【Environment variable]--》【In the second content box, find a row with variable name Path, double click.--> 【PythonThe installation directory is appended to the variable value.
    For example, the original value; C:\python27, remember that there is a semicolon ahead.

linux:

1
2
3
No installation, original Python environment
  
ps:If you take it with yourself2.6,Please update to2.7

Update Python

windows:

1
Unload and reload

linux:

LinuxYum relies on its own Python to prevent errors. This update is actually installing another Python.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
View the default Python version
python -V
  
1、Install GCC for compiling Python source code
    yum install gcc
2、Download the source package, https://www.python.org/ftp/python/
3、Unzip and enter the source code file
4、Compile and install
    ./configure
    make all
    make install
5、View version
    /usr/local/bin/python2.7 -V
6、Modify the default Python version
    mv /usr/bin/python /usr/bin/python2.6
    ln -s /usr/local/bin/python2.7 /usr/bin/python
7、Preventing Yum from executing exceptions and modifying the Python version used by yum
    vi /usr/bin/yum
    Head the head#!/usr/bin/python /usr/bin/python2.6

Leave a Reply

Your email address will not be published. Required fields are marked *