Install python3 under linux

Install python3 under linux

  1. Official website https://www.python.org/downloads/ download python3 source code
  2. mkdir /usr/local/python3 Create a new python3 installation directory
  3. ./configure --prefix=/usr/local/python3 Set the python3 installation directory
  4. make compile
  5. make install install
  6. PATH=$PATH:/usr/local/python3/bin Set the python3 environment variable, which will take effect immediately, and will be invalid after restarting
  7. Modify /etc/profile, add PATH=$PATH:/usr/local/python3/bin to set python3 environment variable, it will take effect permanently after restart
  8. Enter python3 to run directly

    Note: The echo $PATH command can view the current environment variables

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326045357&siteId=291194637