error after upgrading couchapp: ImportError: cannot import name oauth2

132 views
Skip to first unread message

James Marca

unread,
Jul 26, 2010, 3:52:18 PM7/26/10
to CouchApp
Hi all,

In the process of trying to add documentation to my couchapp, I
upgraded couchapp to the latest git version, and then back down to
0.6.3. Regardless, since the upgrade I cannot run couchapp. It fails
with the following error:

$ couchapp
Traceback (most recent call last):
File "/usr/bin/couchapp", line 8, in <module>
load_entry_point('Couchapp==0.6.3', 'console_scripts', 'couchapp')
()
File "/usr/lib64/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/
pkg_resources.py", line 318, in load_entry_point
File "/usr/lib64/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/
pkg_resources.py", line 2221, in load_entry_point
File "/usr/lib64/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/
pkg_resources.py", line 1954, in load
File "/usr/lib64/python2.6/site-packages/Couchapp-0.6.3-py2.6.egg/
couchapp/dispatch.py", line 10, in <module>
import couchapp.commands as commands
File "/usr/lib64/python2.6/site-packages/Couchapp-0.6.3-py2.6.egg/
couchapp/commands.py", line 19, in <module>
from couchapp import clone_app
File "/usr/lib64/python2.6/site-packages/Couchapp-0.6.3-py2.6.egg/
couchapp/clone_app.py", line 20, in <module>
from couchapp import client
File "/usr/lib64/python2.6/site-packages/Couchapp-0.6.3-py2.6.egg/
couchapp/client.py", line 20, in <module>
from restkit.util import oauth2 as oauth
ImportError: cannot import name oauth2

I tried upgrading restkit, but that didn't seem to work:

Installed /usr/lib64/python2.6/site-packages/restkit-2.1.0-py2.6.egg
Processing dependencies for restkit==2.1.0
Finished processing dependencies for restkit==2.1.0

Any help on this would be appreciated. I do not grok python at all.

Regards,
James

James Marca

unread,
Jul 26, 2010, 7:33:39 PM7/26/10
to CouchApp
More information on this:

I backed up to version 0.6.2 using the tags in git, and everything
works. Then I applied up to git commit id
ccb8a6492b3f6d5945d3e0f57d3500d44da1995c

and then

sudo python setup.py install

and everything worked fine. Then I incrementally applied the git
commits that affected the file couchapp/client.py, installing the new
change at every step of the way, and it worked fine every step of the
way all the way up to the latest commit.

So, I checked another machine that is on 0.6.2. I did a git pull, and
then

sudo python setup.py install

here is the tail end of the output of that

...
Installed /usr/lib64/python2.6/site-packages/Couchapp-0.7.0-
py2.6.egg
Processing dependencies for Couchapp==0.7.0
Searching for restkit>=2.1.0
Reading http://pypi.python.org/simple/restkit/
Reading http://bitbucket.org/benoitc/restkit/
Reading http://benoitc.github.com/restkit
Best match: restkit 2.1.0
Downloading http://pypi.python.org/packages/source/r/restkit/restkit-2.1.0.tar.gz#md5=f6672cfa1bad1615e5f3887c4eb65321
Processing restkit-2.1.0.tar.gz
Running restkit-2.1.0/setup.py -q bdist_egg --dist-dir /tmp/
easy_install-_y4YdV/restkit-2.1.0/egg-dist-tmp-PyWIAd
warning: no files found matching 'distribute_setup.py'
Adding restkit 2.1.0 to easy-install.pth file
Installing restcli script to /usr/bin

Installed /usr/lib64/python2.6/site-packages/restkit-2.1.0-
py2.6.egg
Finished processing dependencies for Couchapp==0.7.0

But then on this machine, once again I get the error:

couchapp
Traceback (most recent call last):
File "/usr/bin/couchapp", line 9, in <module>
load_entry_point('Couchapp==0.7.0', 'console_scripts', 'couchapp')
()
File "/usr/lib64/python2.6/site-packages/pkg_resources.py", line
299, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib64/python2.6/site-packages/pkg_resources.py", line
2229, in load_entry_point

... (as before)

This time I tried going backwards through the commits shown by

git log master couchapp/client.py

and each time it failed to run couchapp until I got to
ccb8a6492b3f6d5945d3e0f57d3500d44da1995c

commit ccb8a6492b3f6d5945d3e0f57d3500d44da1995c
Author: Benoit Chesneau <bche...@gmail.com>
Date: Tue Jul 20 19:55:29 2010 +0200

update retskit to last stable version and bumlp version number


Then couchapp once again ran after installing. Then I immediately
did

git merge master
sudo python setup.py install

and again, couchapp works fine.

So my guess is something isn't getting installed properly in master
that gets installed along the way after commit
ccb8a6492b3f6d5945d3e0f57d3500d44da1995c.

That's about all the help I can give on this one.

Regards,
James

Benoit Chesneau

unread,
Aug 14, 2010, 1:24:19 AM8/14/10
to CouchApp
Hi,

I don't know what you're trying here. What is your version of p ? Did
you removed all version of restkit ?

Also if you use couchapp from code which isn't recommended:

1. make sure restkit was correctly installed. Here sound like you have
a error with a missing file in MANIFEST. fixed in 2.1.5 but it should
work with previous versions (tested on clean osx, ubuntu, openbsd,
freebsd and windows).

The following command line should give you current version of
restkit :
(couchapp_env)enlil:restkit benoitc$ python -c "import restkit ; print
restkit.__version__"
2.1.5

2. Make sure you reinstall each time couchapp (better is to use
develop rather than install with setup.py in this case)
2. remove all pyc in your pulled code if there are : find . -name
"*.pyc" -exec rm {} \;
3. If none of above worked, remove all couchapp/restkit version you
have.

Anyway if you want to use latest couchapp on your system, pip is
better for that, you can follow instructions here :

http://couchapp.org/page/installing

Hope it helps.

- benoit

Benoit Chesneau

unread,
Aug 14, 2010, 1:28:08 AM8/14/10
to CouchApp


On Aug 14, 7:24 am, Benoit Chesneau <bchesn...@gmail.com> wrote:
> Hi,
>
> I don't know what you're trying here. What is your version of p ? Did
> you removed all version of restkit ?
>
s/p/python

Benoit Chesneau

unread,
Aug 14, 2010, 4:28:05 AM8/14/10
to CouchApp

I've posted a new wiki about installing couchapp from sources on the
website:

http://www.couchapp.org/page/installing-from-source

Hope it will help you.


- benoit

James Marca

unread,
Aug 18, 2010, 2:33:46 PM8/18/10
to CouchApp
Hi, I missed your earlier replies.

Apparently no one else had this problem, and I just followed the
instructions at [http://couchapp.org/page/installing-from-source] on
my one remaining "clean" machine, and it worked fine. Sorry about the
noise.

By way of explanation, all I was trying to do was update couchapp on
relatively unused machine, and something went wrong. My wild guess
was that somewhere along the line of updating the code in git, a
required python library wasn't getting installed. So when I jumped
from 0.6.2 to the git head (pre 0.7), couchapp started to fail. If I
applied each git commit in order and installed couchapp each time, it
worked every time. So I went backwards through the commits,
installing each time and getting failures each time, until I got to
commit ccb8a6492b3f6d5945d3e0f57d3500d44da1995c, at which point
couchapp started to work again, and jumping to the HEAD was fine.

Regards,
James

P.S. couchapp rocks.
Reply all
Reply to author
Forward
0 new messages