Can't import Connection from pymongo using mongodb_log [closed]
Hi,
I am trying to use mongodb_log
I installed mongodb_log with:
git clone https://github.com/timn/ros-mongodb_log.git mongodb_log
cd mongodb_log
make
I also installed pymongo with:
$ git clone git://github.com/mongodb/mongo-python-driver.git pymongo
$ cd pymongo/
$ python setup.py install
However, when I start the application using:
$ rosrun ngodb_log mongodb_log -a
I get an error saying:
Traceback (most recent call last):
File "/home/<xxxx>/KnowRob_ws/src/mongodb_log/bin/mongodb_log", line 68, in <module>
from pymongo import Connection, SLOW_ONLY
ImportError: cannot import name Connection
Looking into the pymongo source code from git I indeed cannot find a class named Connection. I do however find a class named MongoClient, which takes the same arguments. Changing mongodb_log.py from 'Connection' to 'MongoClient' allows me to run the application with the following output:
Updated graphs, total queue size 0, dropped 0, took 0:00:00.000381
Updated graphs, total queue size 0, dropped 0, took 0:00:00.000393
...
Is this a bug or am I missing something? Or should I contact the pymongo maintainer?
Just an observation:
timn/ros-mongodb_log
hasn't been updated since 2012. That's 8 years.There is every reason to assume all of its dependencies have been updated and the thing suffers from serious bit rot.
It looks like
ros-mongodb_log
repository is outdated/unmaintained (last commit in 2012).The code used to release the
mongodb_log
ROS package is at https://github.com/strands-project/mo... It can also be installed from packagesapt install ros-melodic-mongodb-log
Maybe you'll have more luck trying those
@marguedas This solved it for me, thanks!
Great!
Follow-up ticket to fix the wiki inconsistency: https://github.com/strands-project/mo...