[Practice] How to install python3.6 on Ubuntu system

1 ,Summary#

This article explains how to install python3.6 on Linux system (Ubuntu).

2 , Front prompt#

If python2 is installed on this machine, try to leave it alone, just use python3 to run python scripts, because there may be programs that rely on the current python2 environment, such as yum! ! ! ! !
Don't touch the existing python2 environment!

3 , Install python3.6

3.1 Download Python3

URL: https://www.python.org/downloads/
After downloading from the website, upload it to the Ubuntu environment, or order the download directly.
Assuming the working directory is cd /usr/local, execute the download version command

 wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz

3.2 Install python3

Unzip the downloaded compressed file

 tar -xf Python-3.6.3.tgz

3.3 Enter the decompressed directory, compile and install##

 cd Python-3.6.3./configure --prefix=/usr/local/python3 

3.4 Compile and install##

 make
 make install

3.5 Build python3 soft chain##

 ln -s /usr/local/python3/bin/python3 /usr/bin/python3

3.6 Add /usr/local/python3/bin to PATH

 vim ~/.bash_profile

Edit the content and add python3 executable files.

# Get the aliases and functions
if[-f ~/.bashrc ]; then
.~ /.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/local/python3/bin
export PATH

Press ESC, type: wq and press Enter to exit.

After the modification, remember to execute the following command to make the modification in the previous step take effect:

 source ~/.bash_profile

3.7 Check whether Python3 and pip3 are normally available##

 python3 -V
 pip3 -V
# python3 -V
Python 3.6.1
# pip3 -V
pip 9.0.1from/usr/local/python3/lib/python3.6/site-packages(python 3.6)

If it doesn't work, create a pip3 soft link:

 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

Recommended Posts

[Practice] How to install python3.6 on Ubuntu system
How to install Python 3.8 on Ubuntu 18.04
How to install Python2 on Ubuntu20.04 ubuntu/focal64
How to install Ruby on Ubuntu 20.04
How to install Memcached on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
How to install MySQL on Ubuntu 20.04
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
How to install Anaconda3 on Ubuntu 18.04
How to install Memcached on Ubuntu 18.04
How to install Jenkins on Ubuntu 16.04
How to install MemSQL on Ubuntu 14.04
How to install Go on Ubuntu 20.04
How to install MongoDB on Ubuntu 16.04
How to install Mailpile on Ubuntu 14.04
How to install PrestaShop on Ubuntu 16.04
How to install Skype on Ubuntu 20.04
How to install Jenkins on Ubuntu 20.04
How to install Python 3.8 on CentOS 8
How to install KVM on Ubuntu 18.04
How to install KVM on Ubuntu 20.04
How to install opencv3.0.0 on ubuntu14.04
How to install Anaconda on Ubuntu 20.04
How to install Prometheus on Ubuntu 16.04
How to install Jenkins on Ubuntu 18.04
How to install Apache on Ubuntu 20.04
How to install R on Ubuntu 20.04
How to install Python on CentOS 8
How to install Moodle on Ubuntu 16.04
How to install Solr 5.2.1 on Ubuntu 14.04
How to install Teamviewer on Ubuntu 16.04
How to install MariaDB on Ubuntu 20.04
How to install Nginx on Ubuntu 20.04
How to install Mono on Ubuntu 20.04
How to install Go on Ubuntu 20.04
How to install Zoom on Ubuntu 20.04
How to install Nginx on Ubuntu 16.04
How to install OpenCV on Ubuntu 20.04
How to install Spotify on Ubuntu 20.04
How to install Postman on Ubuntu 18.04
How to install Go 1.6 on Ubuntu 16.04
How to install Go on Ubuntu 18.04
How to install MySQL on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 20.04
How to install VLC on Ubuntu 18.04
How to install TeamViewer on Ubuntu 20.04
How to install Webmin on Ubuntu 20.04
How to install theano and keras on ubuntu system
How to install Docker Compose on Ubuntu 18.04
How to install Ubuntu on Raspberry Pi
How to install Bacula Server on Ubuntu 14.04
How to install MySQL on Ubuntu 18.04 (linux)
Install Python3 on Ubuntu 14.04