In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In view of the process of upgrading python3.5.2 by python2.7.6 in Linux environment in CVM, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Demand
Server: in Linux environment, there are some built-in Python2 versions and sometimes other versions of Python that have just been installed. When a new version comes out, a new version of the software is often selected for installation.
Reason
When you choose a new version of the software to install during development, consider it from the following point of view.
Some third-party libraries of the old version will be updated with the new version of the software, and there will be no one to maintain and update the third-party libraries supported by the old version. Later in the process of use, if there is a bug, it will take a lot of effort to solve.
Steps
Based on the above requirements, I will produce ython2.7.6 on virtual machines to upgrade python3.5.2. The main steps are as follows:
Go to python's website to download the new version of python,python3.5.2 on https://www.python.org/, which was just released in 2016.
1. Upload python3.5.2.tgz to the linux directory
two。 Decompress tar-zxvf python3.5.2.tgz
3. Enter the extracted python directory cd python3.5.2
4. Installation and compilation
(1) run the. / configure command
Supplement: after the configure command is executed, a Makefile file is generated, and this Makefile is mainly used by the next make command. Open Makefile and you will find that there is a build order, and Linux needs to build (build) program components in the order specified by Makefile.
Note: sometimes an error is reported when executing this command. Generally, it is reported that there is no permission. Execute chmod 777 * in the python directory first, and then execute the command again.
(2) run the make command
Make actually compiles your source code and generates the execution file.
(3) run the make install command
Make install actually copies the generated execution files to the necessary directories on the linux system, such as / usr/local/bin, so that all user can run the program.
5. Establish a link to the new version of python
(1) the old version is not overwritten at this time, and then change the original / usr/local/bin/python link to another name
Run mv / usr/local/bin/python / usr/local/bin/python_old2
(2) establish a link to the new version of python
Run ln-s python installation directory / bin/python3.5 / usr/local/bin/python
6. Verification
Enter python
From the figure above, you can see that the python3.5.2 upgrade was installed successfully.
This is the answer to the question about the process of upgrading python2.7.6 to python3.5.2 in Linux environment in CVM. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
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.