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
effect: The GROUP_CONCAT function can concatenate...
How to set up a MySQL short link 1. Check the mys...
Problem Description I created three virtual machi...
Table of contents Manual deployment 1. Create a s...
Preface Today, when I was using a self-written co...
Comprehensive understanding of html.css overflow ...
Preface This article is quite detailed and even a...
1. Understanding the meaning of web standards-Why...
1. To optimize the query, try to avoid full table...
1. Stop the database server first service mysqld ...
This article describes the Linux file management ...
1. Basic Use It can be instantiated through the M...
Preface As a heavy user of front-end frameworks, ...
This article example shares the specific code of ...
Pull the image # docker pull codercom/code-server...