Install python3 under linux
- Official website https://www.python.org/downloads/ download python3 source code
- mkdir /usr/local/python3 Create a new python3 installation directory
- ./configure --prefix=/usr/local/python3 Set the python3 installation directory
- make compile
- make install install
- PATH=$PATH:/usr/local/python3/bin Set the python3 environment variable, which will take effect immediately, and will be invalid after restarting
- Modify /etc/profile, add PATH=$PATH:/usr/local/python3/bin to set python3 environment variable, it will take effect permanently after restart
Enter python3 to run directly
Note: The echo $PATH command can view the current environment variables