Python is a computer programming language. The succinct and extensible nature of the Python language has led to an increasing number of people using the language for scientific computing research, even setting up school courses. If the Python version is too low, it will not. Conducive to the use of the Python language, the following small series will introduce you to the way CentOS upgrades Python.
Host1Free's VPS is installed with CentOS 5.8 Final. Executing python -V (uppercase V) can see the version is Python 2.4.3. This is indeed an old version, but this is already a software library. The latest version. At this point you need to compile and install the latest Python 2.7.3.
One. Preparations
1. Install gcc:
GNU GCC compiler. Execution:
yum install gcc
2. Install the zlib library:
This library is not required, but if you do not install this library, it will cause Python's zlib built-in module to fail. Use, further can not use Python Egg to install the module, causing various troubles, so in order to avoid trouble, still install it. Execution:
yum install zlib zlib-devel
3.Download and extract the Python source package
Execute in order:
wget http://www. Python.org/ftp/python/2.7.3/Python-2.7.3.tgz #Download Python source package
tar zxvf Python-2.7.3.tgz #Unpack Python source package
two. Compile and install Python
Execute the following command in order:
cd Python-2.7.3
. /configure
make && make install
Compilation and installation of Python is time consuming. It is convenient to create a screen window before executing the above instructions.
After the above command is executed, we execute python -V again. 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
After installation, because CentOS's yum depends on the system's own Python 2.4.3, if you use Python 2.7.3 to run it may be wrong, so we have to /usr/bin/yum file The first line in the #! /usr/bin/python is modified to #! /usr/bin/python2.4, so yum is executed when the old version of Python 2.4.3 is called. Modification can be done with vi, if you are not familiar with vi, you can use the SFTP function of Bitvise SSH Client to download the file, use Notepad++ (do not use the notebook that comes with Windows) to modify it and then upload it back (嘿嘿, I This is how it works once.)
Finally, install setuptools. When you download the Python module later, you can use the easy_install command. Execution:
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 below:
the above is a Python version of CentOS upgrade method introduced, because Python is not automatically updated to 2.4.3, if you want to To use the latest Python version you will need to manually update it yourself.
Ncurses is a library. The most used component is a form. In the operation of Linux system, many frie
When we are doing Linux system operation, sometimes there will be a network disconn
Under Linux, you need to implement file transfer between two servers. You can use t
Many Linux users did not allocate the /var partition when they installed the system
How to use Ctags tool to quickly find source code in Linux
Using the find command in Linux to find files How to ignore certain directories
How to use the find command in Linux
How to configure Nginx under Linux to restrict website users to use proxy IP access
Linux ps command example summary
How do Linux systems use the at/crontab directive?
Linux removes the physical volume of PV in LVM
Using Linux routing and forwarding function to share the Internet
What are the commands for monitoring the performance of Linux systems?
Ubuntu tips for installing Visual Studio Code
Ubuntu prompts missing fonts after installing WPS. What should I do?
Windows 7 20 application tips summary (2)
Computer installation operating system driver installation: First, the driver introduction (a)
After WinXP boot, the solution to find the comctl32.dll file is not found.
Windows theme crack (general patch) installation instructions
What are the advantages of the Win10 system? What are the benefits of upgrading Win10?
Debian boot does not enter the graphical interface method
Skype version 11.10.147 fixes crash in Win10 preview version