1
我正在使用mongoengine ORM,但我最近將mongoengie升級到了0.9,這讓我將pymongo降級到了2.8版本。每當我嘗試使用的代碼ImportError:無法導入名稱UNAUTHORIZED_CODES
from mongoengine import *
connect('dbName')
我得到這個錯誤
/usr/bin/python2.7 /root/Documents/Projects/BetCafe/main/tester.py
Traceback (most recent call last):
File "/root/Documents/Projects/BetCafe/main/tester.py", line 1, in <module>
from mongoengine import *
File "/usr/local/lib/python2.7/dist-packages/mongoengine/__init__.py", line 3, in <module>
import fields
File "/usr/local/lib/python2.7/dist-packages/mongoengine/fields.py", line 19, in <module>
import gridfs
File "/usr/lib/python2.7/dist-packages/gridfs/__init__.py", line 32, in <module>
from pymongo.common import UNAUTHORIZED_CODES, validate_string
ImportError: cannot import name UNAUTHORIZED_CODES
Process finished with exit code 1
我試圖重新安裝兩個pymongo和mongoengine要對數據庫的連接,但他們都沒有工作
任何幫助將不勝感激。
升級pymongo?升級網格? – Evert