In some cases, such as installing a cool tool, Python 3.6+ is required. At this time, you can choose to download the source code from Python official website and then compile it. However, compilation errors may occur due to various problems. For me who just want to install a higher version of Python to use Cool's tools,
Solving these compilation problems step by step from the beginning is not what I want, so is there a way to install Python directly with apt install
? The answer is Yes, detailed below (that is, three commands).
In order to use add-apt-repository
, you need to install the following packages first:
sudo apt-get install software-properties-common
On Ubuntu's Package Management Website, there is a special PPA that maintains binary packages from Python2.3 to Python3.8. You can directly add the PPA source and install Python:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y python3.7
If you want to install another version of Python, change the above 3.7
to the corresponding version number:
sudo apt install -y python3.6
After installing the corresponding version, you can use it with Pipenv to realize multi-version Python management and package installation.
Recommended Posts