在eclipse上无法从python连接到mongodb

时间:2012-03-15 14:52:24

标签: python eclipse mongodb

我第一次尝试使用mongodb和python(使用eclipse)

import pymongo
connection = pymongo.Connection("localhost",27017)
db=connection.test
db.name

出现此错误:

Traceback (most recent call last):
 File "C:\Users\chatterjees\workspace\de.vogella.python.first\src\FirstModule.py", line      2, in <module>
    connection = pymongo.Connection("localhost",27017)
  File "build\bdist.win32\egg\pymongo\connection.py", line 381, in __init__
  File "build\bdist.win32\egg\pymongo\connection.py", line 659, in __find_node
pymongo.errors.AutoReconnect: could not connect to localhost:27017: [Errno 10061] No     connection could be made because the target machine actively refused it

0 个答案:

没有答案