centos7 下安裝pymongo

因爲pymongo只有.whl安裝包,所以須要先安裝wheelpython

輸入以下指令安裝wheellinux

# pip install wheel

接着下載pymongo對應版本,必定要與python的版本對應,如箭頭所示
centos


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

下載後安裝:code

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

檢查安裝版本:orm

[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'
相關文章
相關標籤/搜索