On Tue, Jan 5, 2010 at 9:45 PM, Matt Feifarek <[email protected]> wrote:
> On Tue, Jan 5, 2010 at 11:13 PM, Matt Feifarek <[email protected]>
> wrote:
>>
>> I upgraded a working Pylons 0.9.7 app to the new semantics from Pylons 1.0
>> (via pip install pylons==dev).
>> When I try to run the appserver, I get a traceback:
>
> Here's an easily reproducible case:
> w...@dude:~$ virtualenv --distribute --no-site-packages -p
> /usr/bin/python2.5 froon
> /usr/local/bin/virtualenv:5: UserWarning: Module pkg_resources was already
> imported from /usr/lib/python2.6/dist-packages/pkg_resources.pyc, but
> /usr/local/lib/python2.6/dist-packages is being added to sys.path
>   from pkg_resources import load_entry_point
> /usr/local/bin/virtualenv:5: UserWarning: Module site was already imported
> from /usr/lib/python2.6/site.pyc, but /usr/local/lib/python2.6/dist-packages
> is being added to sys.path
>   from pkg_resources import load_entry_point
> Running virtualenv with interpreter /usr/bin/python2.5
> New python executable in froon/bin/python2.5
> Also creating executable in froon/bin/python
> Installing
> distribute...........................................................................................................................................................................done.
> w...@dude:~$ cd froon
> w...@dude:~/froon$ source bin/activate
> (froon)w...@dude:~/froon$ pip install pylons==dev
>     [ lots of stuff happens here ]
> Successfully installed Beaker decorator FormEncode Mako nose Paste
> PasteDeploy PasteScript Pygments pylons Routes simplejson Tempita WebError
> WebHelpers WebOb WebTest
> (froon)w...@dude:~/froon$ paster create -t pylons oof
> Traceback (most recent call last):
>   File "/home/work/froon/bin/paster", line 9, in <module>
>     load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')()
>   File
> "/home/work/froon/lib/python2.5/site-packages/paste/script/command.py", line
> 73, in run
>     commands = get_commands()
>   File
> "/home/work/froon/lib/python2.5/site-packages/paste/script/command.py", line
> 115, in get_commands
>     plugins = pluginlib.resolve_plugins(plugins)
>   File
> "/home/work/froon/lib/python2.5/site-packages/paste/script/pluginlib.py",
> line 81, in resolve_plugins
>     pkg_resources.require(plugin)
>   File
> "/home/work/froon/lib/python2.5/site-packages/distribute-0.6.8-py2.5.egg/pkg_resources.py",
> line 633, in require
>     needed = self.resolve(parse_requirements(requirements))
>   File
> "/home/work/froon/lib/python2.5/site-packages/distribute-0.6.8-py2.5.egg/pkg_resources.py",
> line 531, in resolve
>     raise DistributionNotFound(req)  # XXX put more info here
> pkg_resources.DistributionNotFound: Not Found: Pylons-0.9.7-py2.5 (did you
> run python setup.py develop?)

That's what I hate about Paste and entry points and pkg_resources.
These errors occur and can be impossible to trace because the
traceback doesn't tell you who's asking for the package.  You can try
the Python debugger but the error is probably way down in a
sys.path/entry point loop somewhere. I don't remember if the debugger
will actually break there or sail through it.

The most likely place is in your application's setup.py or its
egg-info.  Reinstalling the application (which regenerates its
egg-info) may fix it.  You may have to manually delete the
application's .egg-link file and its entry in easy_install.pth before
reinstalling; sometimes that clears it up. And ditto for Pylons'
egg-link and easy_install.pth entry.

Also look for any script in your bin directory that has an absolute
path to a certain Python interpreter or requires that Pylons version.

My colleague Chris always says, "Why doesn't Pylons/Paste just try to
import something before requiring it?  That would avoid a lot of
problems if the import works but the metadata situation is slightly
off."

-- 
Mike Orr <[email protected]>
-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.


Reply via email to