设置PyMongo

时间:2014-09-01 20:14:30

标签: python mongodb pymongo

没关系,需要做pip install --update pymongo

我正在关注此页面 - http://api.mongodb.org/python/current/tutorial.html

当我放入

from pymongo import MongoClient

我收到此错误。我做错了什么?

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/util.py", line 284, in _exit_function
    info('process shutting down')
TypeError: 'NoneType' object is not callable
Error in sys.exitfunc:
Error in sys.excepthook:
Traceback (most recent call last):
  File "/Applications/TextMate.app/Contents/SharedSupport/Bundles/Python.tmbundle/Support/sitecustomize.py", line 44, in tm_excepthook
    io = fdopen(error_fd, 'wb', 0)
OSError: [Errno 9] Bad file descriptor

Original exception was:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/util.py", line 284, in _exit_function
    info('process shutting down')
TypeError: 'NoneType' object is not callable

1 个答案:

答案 0 :(得分:0)

实际上是由于旧版的pymongo。 pip install --update pymongo修复它