In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about how to install and uninstall Python 3.8 under Ubuntu. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
Python 3.8 installation
In Ubuntu 16.04, the default version of Python 3 is 3.5:
$ python3 -VPython 3.5.2
This article takes Ubuntu 16.04 as an example, and the same method applies to Ubuntu 18.04.
1. Install Python 3.8 via Apt
Python 3.8 is not included in Ubuntu's official apt library yet, so use the deadsnakes PPA library to install it.
1.1. Install dependency packages
$ sudo apt-get update$ sudo apt-get install software-properties-common
1.2. Add deadsnakes PPA source
$ sudo add-apt-repository ppa:deadsnakes/ppaPress [ENTER] to continue or Ctrl-c to cancel adding it.
1.3. Install Python 3.8
$ sudo apt-get update$ sudo apt-get install python3.8 $python3.8-VPython 3.8.22. Configure python3.8 as the system default python3
Modifying the default python3 will cause various problems such as not opening Terminal. It is recommended not to modify it. See Ubuntu 16.04 TLS for a workaround: Terminal cannot be opened
2.1. Add Python versions to update-alternatives
$ which python3.8/usr/bin/python3.8$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1$ which python3.5/usr/bin/python3.5$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 2
2.2. Configuration python3 default points to python3.8
$ sudo update-alternatives --config python3There are 2 choices for the alternative python3 (providing /usr/bin/python3). Selection Path Priority Status------------------------------------------------------------* 0 /usr/bin/python3.5 2 auto mode 1 /usr/bin/python3.5 2 manual mode 2 /usr/bin/python3.8 1 manual modePress to keep the current choice[*], or type selection number: 2
Select/Enter 2, Enter.
2.3 Testing Python versions
$python3-VPython 3.8.2 Second, uninstall python3.81, uninstall python3.8sudo apt-get remove python3.82, uninstall python3.8 and its dependencies sudo apt-get remove --auto-remove python3.83, remove python3.8sudo apt-get purge python3.8orsudo apt-get purge --auto-remove python3.8
Notes:
This method is more thorough in unloading Python, so it is suitable for use when replacing Python versions.
--For children who want to uninstall Python completely, but cannot accept that some Python components cannot be used after complete uninstall, please be cautious!
Thank you for reading! About "How to install and uninstall Python 3.8 under Ubuntu" This article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.