← Back to team overview

caneypuggies team mailing list archive

Re: setuptool error

 

Hi Diana,

If I recall correctly, you weren't the only one getting the setuptools
error, so I'm copying my reply to the CaneyPUGgies mailing list.

On 09/01/2010 09:47 AM, Diana Graham wrote:
> I'm still getting the setup tools error and I thought this might work.
> What do you think?
>   

You could try running the command he mentions below ("easy_install -U
setuptools") and its effects can be corrected easily enough (by
following the directions in step 3 below), but I don't think that
command will solve the problem, because I traced the error I was getting
back to the fact that TurboGears 2.1 explicitly requires
setuptools-0.6c9, and upgrading setuptools will bring it up to
setuptools-0.6c11, which would still cause an error because the earlier
(not the most recent) version is required.

Here is what I just did to correct the setuptools error on my computer.

1.  In Meld, I compared 1) the virtualenv I'm using for another
TurboGears 2.1 project I'm working on that is thankfully free from the
setuptools error with 2) the virtualenv I'm using for the Reformed
Churches Locator code.  (Note:  Virtualenv 1) uses Python 2.6, and 2)
uses Python 2.5, so the files I compared are not all in the same
directories, which meant I needed to compare virtualenv1/lib/python2.6
with the respective virtualenv2/lib/python2.5, in case you end up doing
a similar comparison in the future.)

2.  I noticed that
virtualenv1/lib/python2.6/site-packages/setuptools.pth contained
"./setuptools-0.6c9-py2.6.egg", but
virtualenv2/lib/python2.5/site-packages/setuptools.pth contained
"./distribute-0.6.10-py2.6.egg".  I believe the reason for this
difference is 1) that the most recent versions of setuptools are now
packaged in an egg named "distribute", 2) I had installed the most
recent version of setuptools in virtualenv1, and 3) I already fixed the
problem in virtualenv1 by manually installing setuptools-0.6c9, then
manually changing the setuptools.pth file to point to that earlier
version of setuptools.

3.  So to fix this, what I needed to do, and what you can do, if (for
example) your virtualenv is for Python 2.5 (otherwise change the
references to "2.5" to "2.6"), is run the following commands:

# change to correct directory
cd ~/Projects/
# activate virtualenv
source tg21env/bin/activate
# allow installing multiple versions of setuptools
easy_install -m setuptools
# download & install correct setuptools egg
easy_install
http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c9-py2.5.egg
# set setuptools.pth to point to setuptools-0.6c9
# this last step was all I needed to do (since I had already done the
steps above), but you may need to do the steps above, also
echo "./setuptools-0.6c9-py2.5.egg" >
tg21env/lib/python2.5/site-packages/setuptools.pth

To test whether this fixed the problem, I started the web server
<http://caneypuggies.alwaysreformed.com/wiki/StartRCL>, then wrote the
incorrect code "test = model.one" on a line in the "index" method in
rcl/controllers/root.py, then loaded the index page of the application
in my web browser, and instead of getting the setuptools error in the
terminal, now I get the TurboGears debugging interface in the web
browser, which means the setuptools error is fixed, and now TurboGears
will help us have an easier time debugging our programming errors.

I posted these instructions in the ticket on the wiki
<http://caneypuggies.alwaysreformed.com/ticket/1#comment:2> and in the
bug on Launchpad
<https://bugs.launchpad.net/reformedchurcheslocator/+bug/600879> in case
you would like to post comments on them there.

If you are getting the setuptools error, please let me know if these
instructions do or don't work to resolve the setuptools error on your
computer.  Thanks!

Tim
>
> Re: Installing turbogears on Ubuntu 10.04
> Click to flag this post 
> by Timuçin Kızılay Jul 08, 2010; 03:13am :: Rate this Message:    - Use
> ratings to moderate (?)
>
> Reply | Print | View Threaded | Show Only this Message
>
>
>
> Hello,
>
> I had some troubles installing tg2.1b2 on ubuntu 10.04 too. I think the 
> problem was with the setuptools. I solved the problem by forcing 
> setuptools to upgrade. I had created a small .sh file to install again 
> later. Here is the script:
> --------------------
>
> #!/bin/sh
> # Create virtual environment
> virtualenv --no-site-packages tg21env
> cd tg21env
> # Activate virtual environment
> source bin/activate
>
> # Install TurboGears 2.1
> easy_install -i http://www.turbogears.org/2.1/downloads/current/index 
> tg.devtools
>
> # Upgrade setuptools package
> easy_install -U setuptools
>
> --------------------
>
> Thanks, 
>
> Diana
>
>
>