Not sure, but I venture a guess anyways.
Did you actually install a python 2.4 or 2.5 version in addition to the 
default 2.6?
Just installing the 2.5 version of setuptools won't help unless you also have 
a 2.5 python installed (yes, you can install several versions of python).

Personally I'd install python 2.5 along with virtualenv. I think Ubuntu has 
backwards compatible python2.5 packages (try something like apt-get install 
python2.5 and apt-get install python2.5-dev) which don't mess up your general 
python setup (python then is not python, but python2.5 - the tab-key is your 
friend there)
Then create a virtual environment (I create different system users for that 
and install the virtual env in their home directory, aka 
virtualenv --python=/usr/bin/python2.5 --no-site-packages /home/my_2.5_user). 
Then a simple su - my_python_2.5_user will get you an isolated py2.5 setup 
(if you add "source bin/activate" to the user's .bashrc).

>From there - logged on as the py2.5 user - you can run easy_install and 
everything else without polluting your system environment. If you don't like 
the outcome anymore, just remove the user with the home directory and nothing 
will have happened to your system.

You definitely don't want to mess with the 2.6 installation, because Ubuntu 
heavily relies on the default python for all the config and setup tools.

Uwe


On Friday 29 May 2009, Adam Yee wrote:
> Hi guys.  I'm new to TG since 3 days ago.  I'm getting this peak.rules
>
> importerror.  Here it is:
> >>> sys.path.append('/home/adam/tg1.1env/mini-blog-3/')
> >>> for x in sys.path: x
>
> ...
> ''
> '/home/adam/tg1.1env/lib/python2.5/site-packages/setuptools-0.6c9-
> py2.5.egg'
> '/home/adam/tg1.1env/lib/python2.5/site-packages/SQLAlchemy-0.5.4p2-
> py2.5.egg'
> '/home/adam/tg1.1env/lib/python2.5/site-packages/WebTest-1.2-
> py2.5.egg'
> '/usr/lib/python2.5/site-packages/virtualenv-1.3.3-py2.5.egg'
> '/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.4p2-py2.5.egg'
> ....
> ...
> ..
> '/home/adam/tg1.1env/mini-blog-3/'
>
> >>> from miniblog3 import model
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/home/adam/tg1.1env/mini-blog-3/miniblog3/model.py", line 7,
> in <module>
>     from turbogears.database import get_engine, mapper, metadata,
> session
>   File "/usr/lib/python2.5/site-packages/TurboGears-1.1b3-py2.5.egg/
> turbogears/__init__.py", line 6, in <module>
>     from turbogears.controllers import (absolute_url, expose, flash,
> validate,
>   File "/usr/lib/python2.5/site-packages/TurboGears-1.1b3-py2.5.egg/
> turbogears/controllers.py", line 16, in <module>
>     from peak.rules import abstract, Method, always_overrides
> ImportError: No module named rules
>
>
> I'm trying to play with my models in the command line.
>
> From what I could find in my google searches, it seems that this issue
> is Ubuntu specific and that it deals with setuptools.  Jaunty defaults
> to Python2.6, so I had to manually install setuptools-0.6c9-py2.5.egg.
>
> I am too new to this stuff to know what is going on.  Any questions?
> Please help.  Thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to