In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "Python 2.7.6 upgrade Python 3.5.2 method under Linux environment", the explanation content in the article is simple and clear, easy to learn and understand, please follow the idea of Xiaobian slowly in-depth, together to study and learn "Python 2.7.6 upgrade Python 3.5.2 method under Linux environment"!
demand
Server: Linux environment is some of the Python2 version comes with other versions of Python sometimes just installed, when the new version comes out, in the development time will often choose the new version of the software to install.
reason
When selecting a new version of software for installation during development, the following considerations are taken into account.
Some third-party software libraries of the old version will be updated with the new version of the software, and the third-party libraries supported by the old version will not be maintained and updated. Later, in the process of using, if bugs appear, it will take a lot of effort to solve them.
step
Based on the above requirements, I will produce Python 2.7.6 upgrade Python 3.5.2 on the VM, the main steps are as follows:
Go to Python's official website https://www.example.com to download the new version of Python, Python 3.5.2, just released in 2016. www.python.org/
1. Upload python 3.5.2.tgz to linux directory
2. Unzip tar -zxvf python3.5.2.tgz
3. Enter the unzipped python directory cd python 3.5.2
4. install compilation
(1) Operation./ Configure Command
After the configure command is executed, a Makefile file is generated, which is mainly used by the next make command. Open Makefile and you will find that there is a build order, Linux needs to build program components in the order specified by Makefile.
Note: Sometimes when executing this command, an error will be reported, usually without permission, in the python directory first execute chmod 777 *, and then execute the command again, successfully passed
(2) Run the make command
Make actually compiles your source code and generates an execution file.
(3) Run the make install command
Make install actually copies the generated executable files to the necessary directories on the linux system, such as/usr/local/bin, so that all users can run the program.
5. Create links to new versions of Python
(1) At this time, the old version is not overwritten, and then the original/usr/local/bin/python link is changed to another name.
Run mv /usr/local/bin/python /usr/local/bin/python_old2
(2) Create links to new versions of Python
Run ln -s python install directory/bin/python3.5 /usr/local/bin/python
6. verification
typing Python
As can be seen from the above figure, Python 3.5.2 upgrade was successfully installed.
Thank you for reading, the above is "Python 2.7.6 upgrade Python 3.5.2 method under Linux environment" content, after learning this article, I believe that everyone on Linux environment Python 2.7.6 upgrade Python 3.5.2 method this problem has a deeper understanding, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
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.