ImportError: cannot import name Resource with python-couchdb 0.7

Bug #566073 reported by Frederik Himpe
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
desktopcouch
Fix Released
Undecided
Unassigned

Bug Description

desktopcouch 0.6.4 fails to start here with python-couchdb 0.7 and
couchdb 0.11:

$ /usr/lib/desktopcouch/desktopcouch-service
Traceback (most recent call last):
  File "/usr/lib/desktopcouch/desktopcouch-service", line 51, in
<module>
    import desktopcouch
  File "/usr/lib/python2.6/site-packages/desktopcouch/__init__.py", line
20, in <module>
    from desktopcouch.start_local_couchdb import process_is_couchdb,
read_pidfile
  File
"/usr/lib/python2.6/site-packages/desktopcouch/start_local_couchdb.py",
line 42, in <module>
    from desktopcouch.records.server import CouchDatabase
  File
"/usr/lib/python2.6/site-packages/desktopcouch/records/server.py", line
25, in <module>
    from couchdb.client import Resource
ImportError: cannot import name Resource

Revision history for this message
sandalle (sandalle) wrote :

Gentoo has this bug at http://bugs.gentoo.org/show_bug.cgi?id=315743
Source Mage GNU/Linux doesn't have gwibber yet because of this bug.

Revision history for this message
sandalle (sandalle) wrote :

This patch switches couchdb.client -> couchdb.http, seems to work for gwibber.

Revision history for this message
Frederik Himpe (fhimpe) wrote :

Unfortunately, it does not seem enough here (desktopcouch 0.6.4, python-couchdb 0.7):

$ /usr/lib/desktopcouch/desktopcouch-service
Traceback (most recent call last):
  File "/usr/lib/desktopcouch/desktopcouch-service", line 51, in <module>
    import desktopcouch
  File "/usr/lib/python2.6/site-packages/desktopcouch/__init__.py", line 20, in <module>
    from desktopcouch.start_local_couchdb import process_is_couchdb, read_pidfile
  File "/usr/lib/python2.6/site-packages/desktopcouch/start_local_couchdb.py", line 42, in <module>
    from desktopcouch.records.server import CouchDatabase
  File "/usr/lib/python2.6/site-packages/desktopcouch/records/server.py", line 27, in <module>
    from desktopcouch.records import server_base
  File "/usr/lib/python2.6/site-packages/desktopcouch/records/server_base.py", line 42, in <module>
    from couchdb.http import ResourceNotFound, ResourceConflict, uri as couchdburi
ImportError: cannot import name uri

Revision history for this message
sandalle (sandalle) wrote :

Yeah, I'm hitting the bug in Comment #3 now, thought it was just a missing dependency, but it's from couchdb-python (I believe) and I haven't fixed it yet. Probably have to do a similar patch.

Revision history for this message
Michael Scherer (misc-zarb) wrote :

It seems that desktopcouch use internal API of python-couchdb, if I understand well the comment on line 997 :

http://code.google.com/p/couchdb-python/source/browse/couchdb/client.py?r=75e9a8141dcf655b3f2c370f123c7277445c8649

I fixed the uri error by cut and pasting the code to desktopcouch, but now, another error arise because Resource object have changed.

Revision history for this message
Michael Scherer (misc-zarb) wrote :

And there is a similar bug report on https://qa.mandriva.com/show_bug.cgi?id=59497

Revision history for this message
Olivier FAURAX (olivier-faurax) wrote :

Gwibber on Mandriva 2010.1 is unlaunchable due to this bug.
Please change the Importance to something else than "Undecided".

Revision history for this message
Michael Scherer (misc-zarb) wrote :

It seems there is a branch with the needed fix : https://code.launchpad.net/~vds/desktopcouch/desktopcouch_couchdb_0_7
but so far, it was not merged ( even if proposed for it ). I am testing it to see if it solve the problem.

Revision history for this message
Vincenzo Di Somma (vds) wrote : Re: [Bug 566073] Re: ImportError: cannot import name Resource with python-couchdb 0.7

I'm the author of that branch.

Revision history for this message
Michael Scherer (misc-zarb) wrote :

So, after testing, I found some problem on gwibber, related to key error exception on _id. I have added a small patch to test it, but I am far from being familliar with gwibber/desktopcouch/couchdb separation or internals. So with : http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/gwibber/current/SOURCES/gwibber-2.30.1-fix_for_new_couchdb.diff?view=log

and http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/desktopcouch/current/SOURCES/desktopcouch-0.6.6-python-couchdb0.7-compat.patch?view=log

gwibber work on a local statunet installation. I will post more information once testers give me feedback ( as I am not a user of microblogging ) .

Revision history for this message
Richard Rath (rcrath) wrote :

I also am hitting this bug when using the quickly development platform in ubuntu 10.10 with default installs of python, desktop couch, etc. I get the following when creating a new project with quickly:

$ quickly create ubuntu-application clipwich

Creating project directory clipwich
Creating bzr repository and commiting
Launching your newly created project!le 0/1
Traceback (most recent call last):
  File "./clipwich", line 32, in <module>
    from clipwich import (
  File "/home/rich/clipwich/clipwich/PreferencesClipwichDialog.py", line 6, in <module>
    from desktopcouch.records.server import CouchDatabase
  File "/usr/lib/python2.6/dist-packages/desktopcouch/records/server.py", line 25, in <module>
    from couchdb.client import Resource
ImportError: cannot import name Resource

I also get an error when running:
[~]$/usr/lib/desktopcouch/desktopcouch-service
Traceback (most recent call last):
  File "/usr/lib/desktopcouch/desktopcouch-service", line 53, in <module>
    from desktopcouch import replication
  File "/usr/lib/python2.6/dist-packages/desktopcouch/replication.py", line 24, in <module>
    from desktopcouch.pair.couchdb_pairing import couchdb_io
  File "/usr/lib/python2.6/dist-packages/desktopcouch/pair/couchdb_pairing/couchdb_io.py", line 28, in <module>
    from desktopcouch.records import server
  File "/usr/lib/python2.6/dist-packages/desktopcouch/records/server.py", line 25, in <module>
    from couchdb.client import Resource
ImportError: cannot import name Resource

Is there a fix for this?

Revision history for this message
Marten de Vries (marten-de-vries) wrote :

This bug also affects me when starting 'lernid', I am using the desktopcouch and lernid version from the ubuntu repositories (maverick). I can also reproduce the error by issuing the command '/usr/lib/desktopcouch/desktopcouch-service' like in the first post.

JACQUELINE (ijdisabest)
Changed in desktopcouch:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.