In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to install python in the ubuntu server, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
What does python mean Python is a cross-platform, interpretive, compiled, interactive and object-oriented scripting language, originally designed to write automated scripts, and is often used to develop independent and large-scale projects as versions are constantly updated and new features are added.
1. View the current python version
$python-version
2. Upgrade to python3.X version
$sudo add-apt-repository ppa:fkrull/deadsnakes# add a source $sudo apt-get update# update source list to get the latest version $sudo apt-get install python3# is installed using apt-get
3. After the installation is completed, there are two ways to change the system environment.
① situation 1:
Using the alias alias, add the following statement to ~ / .bashrc or ~ / .bash_aliases
Alias python=python3
Note: switch back to python2 environment
Alias python=python2
In case 2 of ②, directly change the direction of the version:
(1) check the current default execution environment version. If this item does not contain python, you can skip it.
Android@local:/usr/local/bin$lsapktoolpython
(2) Delete the current default python environment script
Android@local:/usr/local/bin$ sudo rm / usr/local/bin/pythonandroid@local:/usr/local/bin$ lsapktool apktool.jar
(3) check the installed python version contained under the / usr/bin/ path.
Ls / usr/bin/
(4) switch the direction of the following version of / usr/bin/
Android@local:/usr/local/bin$sudo ln-s / usr/bin/python3 / usr/local/bin/python
Note: switch back to python2 environment
Android@local:/usr/local/bin$sudoln-s / usr/bin/python2 / usr/local/bin/python
Other circumstances:
If you encounter other problems that need to be fixed, just download it again:
Sudo apt-getinstall-- reinstall python-minimalsudo apt-getinstall-- reinstall python2.7 after reading the above, do you have any further understanding of how to install python in the ubuntu server? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.