In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about the low version of CentOS programming language python how to manually upgrade, the article is rich in content and professional analysis and description for you, after reading this article, I hope you can get something.
Python is a computer programming language, Python language concise, extensible features lead to the use of this language for scientific computing research more and more people, and even use it to set up the school curriculum, if the Python version is too low will not be conducive to the use of Python language, the following editor will introduce the CentOS upgrade Python method.
Host1Free's VPS is installed with CentOS 5.8Final, and by executing python-V (uppercase V), you can see that the version is Python 2.4.3, which is indeed an old version, but it is already the latest version in the software library. At this point, you need to compile and install the latest Python 2.7.3.
one. Preparatory work
1. Install gcc:
GNU GCC compiler. Execute:
Yum install gcc
two。 Install the zlib library:
This library is not necessary, but if you do not install this library, it will lead to the failure of Python's zlib built-in module, further leading to the inability to use Python Egg to install the module, causing all kinds of trouble, so in order to avoid trouble, install it. Execute:
Yum install zlib zlib-devel
3. Download and extract the Python source code package
Execute in turn:
Wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz # download Python source code package
Tar zxvf Python-2.7.3.tgz # decompress the Python source code package
two. Compile and install Python
Execute the following command in turn:
Cd Python-2.7.3
. / configure
Make & & make install
The compilation and installation of Python is time-consuming, so it is much more convenient to create a screen window before executing the above instructions.
After the above command is executed, we execute python-V again, and we can see that the current version is already Python 2.7.3. If you want to call the old version of Python 2.4.3, execute python2.4.
three. Follow-up work
After installation, because the yum of CentOS depends on the Python 2.4.3 that comes with the system, it may make an error if you run it with Python 2.7.3, so we will set the first line #! in the / usr/bin/yum file! / usr/bin/python changed to #! / usr/bin/python2.4, so that the old version of Python 2.4.3 is called when yum executes. Modification can be done with vi, if you are not familiar with vi, you can use Bitvise SSH Client's SFTP function to download the file, use Notepad++ (do not use Windows's own notepad) and then upload it back (hey, that's what I did the first time).
Finally, to install setuptools, you can directly use the easy_install command when downloading the Python module later. Execute:
Wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
Sh setuptools-0.6c11-py2.7.egg
As shown in the following figure:
The above is the editor for you to share the CentOS programming language python version is too low how to manually upgrade, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.