Reference article
ubuntu source code install python3
linux compile and install python3.6 tutorial details
Ready to work
Installation tool
sudo apt update
sudo apt upgrade
sudo apt install gcc
sudo apt install g++
sudo apt install build-essential checkinstall
sudo apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Officially begin
Download python file
sudo curl -O https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz
Unzip the source package
sudo tar Jxvf Python-3.7.1.tar.xz
Create python installation path
sudo mkdir /usr/python37
Install python
sudo ./configure --enable-optimizations --prefix=/usr/python37
sudo make && make install
Add environment variables
sudo vim /etc/profile
Add at the end
export PATH=$PATH:/usr/python37/bin
alias python="python3.7"
alias pip="pip3.7"
Add user alias
vim ~/.bashrc
Add at the end
alias python="python3.7"
alias pip="pip3.7"
Create soft connection
sudo ln -s /usr/python37/bin/python3.7/bin/python
sudo ln -s /usr/python37/bin/pip3.7/bin/pip
Replace domestic source
cd ~
mkdir .pip
cd .pip
pip.conf
vim pip.conf
Add the following content
[ global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
Update pip
sudo pip install --upgrade pip
to sum up
This is the end of this article on the detailed tutorial of installing python3.7 for ubuntu18. For more related ubuntu18 installation of python3.7 content, please search for the previous articles of ZaLou.Cn or continue to browse the related articles below. Hope you all Support ZaLou.Cn!
Recommended Posts