In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "how to solve the problem of upgrading Python and Mongodb driver installation under Centos". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Check the version of python python-v if it is below 2.7you need to upgrade.
First go to the official website to download the python package you want, and then decompress it. Enter the home directory to do the following (gcc compiler is required)
. / configure-- prefix=/usr/localmake all make install make clean make distclean
After executing these commands, you can see python2.7 in the / usr/local/bin/ directory, and then try to execute / usr/local/bin/python2.7-v if the version number indicates that the installation has been successful. But the upgrade is only halfway through, so you can run python-v on the terminal again and you will find the version number before the upgrade. Do the following at this time.
Establish a soft connection so that the default python of the system points to python2.7
Mv / usr/bin/python / usr/bin/python2.6.6 ln-s / usr/local/bin/python2.7 / usr/bin/python
At this point when you are running python-v, it will be the version you installed.
The version of python has been upgraded, but you are still a few steps away from it.
At this point you can try to execute yum list on the terminal and you will find that the yum instruction is not available because yum is not compatible with python 2.7by default.
We need to modify the / usr/bin/yum file to open it with vim (administrator privileges are required).
The header of the file
! / usr/bin/python
Change to
! / usr/bin/python2.6.6 this is the file you modified the link before.
In this way, the python upgrade work is almost complete.
Install the mongodb driver
After installing python, we use it. Python sometimes needs a lot of third-party libraries. These libraries need to be installed in addition. The main installation tools are setuptools and pip (I won't talk about the difference between these two tools here).
Here's how to install setuptools and mongodb drivers offline on the server (our server is firmly forbidden to go on the extranet, not even for a second).
Install setuptools
Download setuptools-1.4.2.tar.gz
After decompressing, go to the home directory and execute python setup.py install
If the installation process prompts you that the appropriate py package is missing, install the appropriate package through yum (below)
Then recompile and install py, and the installation will be successful after continuing.
Note that the following packages are generally missing
Yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel
After installing setuptools, you can install the driver for mongodb. The method is the same as above.
The content of "how to solve the problem of upgrading Python and Mongodb driver installation under Centos" is introduced here. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.