Check the Python version python -V If it is below 2.7, you need to upgrade. First go to the official website to download the python compressed package you want, and then decompress it. Enter the main directory and perform the following operations (GCC compiler support is required) ./configure --prefix=/usr/local make all make install make clean make distclean After executing these commands, you can see python2.7 in the Create a soft link to make the system default python point to python2.7 mv /usr/bin/python /usr/bin/python2.6.6 ln -s /usr/local/bin/python2.7 /usr/bin/python At this time, when you execute python -V, it will be the version you installed. The Python version has been upgraded, but you still have a few steps to go. At this time, you can try to execute yum list in the terminal and you will find that the yum command does not work. This is because yum is not compatible with python 2.7 by default. We need to modify the /usr/bin/yum file and open it with vim (administrator privileges are required). The file header Change to !/usr/bin/python2.6.6 This is the file you modified before linking This way, the Python upgrade is basically completed. Install MongoDb Driver After installing Python, we use it. Python sometimes requires many third-party libraries. These libraries need to be installed additionally. The main installation tools are setuptools and pip (I won’t explain the difference between these two tools here). Next, we will show you how to install setuptools and MongoDb driver offline on the server (our server is not allowed to access the Internet, not even for a second). Install setuptools Download setuptools-1.4.2.tar.gz After decompression, enter the main directory and execute python setup.py install If the installation process prompts that the corresponding py package is missing, please install the corresponding software package through yum (as follows), Then recompile and install py, and the installation will be successful if you continue. Note that the following packages are usually missing yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel After installing setuptools, you can install the mongodb driver. Same method as above. If you happen to need to install the MongoDB Python driver and you are reading this article from the end to the beginning, you may be able to avoid installing Python twice. Summarize The above is what I introduced to you about upgrading Python and Mongodb driver installation under CentOS. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Node.js implements breakpoint resume
>>: MySQL 8.0.15 installation and configuration graphic tutorial under Win10
As the computer is used, a lot of garbage will be...
This article shares the specific code for Vue to ...
Linux often encounters situations such as adding ...
Click here to return to the 123WORDPRESS.COM HTML ...
There was a problem when installing the compresse...
1. Window -> preferences to open the eclipse p...
The purpose of writing scripts is to avoid having...
This article describes MySQL 8.0 user and role ma...
Use CSS3 to animate the input box similar to the ...
This article shares the specific code of JavaScri...
Basic Concepts Current read and snapshot read In ...
MySql Index Index advantages 1. You can ensure th...
Preface Merging or splitting by specified charact...
HTML forms are used to collect different types of...
Update: Now you can go to the MySQL official webs...