centos7 下安装pymongo

由于pymongo只有.whl安装包,因此需要先安装wheel

输入如下指令安装wheel

# pip install wheel

接着下载pymongo对应版本,一定要与python的版本对应,如箭头所示


# wget https://files.pythonhosted.org/packages/30/f9/78dd244df932309299288a452d1c3524f6f7746f1813b8a8417952b1d9ce/pymongo-3.6.1-cp36-cp36m-manylinux1_x86_64.whl

下载后安装:

# pip install pymongo-3.6.1-cp36-cp36m-manylinux1_x86_64.whl

检查安装版本:

[root@VM_0_8_centos local]# python
Python 3.6.2 (default, May 24 2018, 23:30:13) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymongo
>>> pymonog.version
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'pymonog' is not defined
>>> pymongo.version
'3.6.1'

猜你喜欢

转载自blog.csdn.net/zzzcl112/article/details/80503918