Eclipse / PyDev运行金字塔development.ini问题“pkg_resources.DistributionNotFound:”

时间:2011-01-08 17:02:15

标签: python eclipse pylons pydev pyramid

我开始使用Pyramid框架并试图在Eclipse中运行它。

我的运行配置是:

主要模块: /home/ben/env/bin/paster

计划参数: serve /home/ben/dev/python/pyramid/firstPyramid/first/development.ini

这个virtualenv贴纸将从命令行中提供development.ini。但是,在eclipse中运行它会给出:

[Invalid file specified for console output: ]
Traceback (most recent call last):  
  File "/home/ben/env/bin/paster", line 8, in <module>  
    load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')()  
  File "/home/ben/env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 84, in run  
    invoke(command, command_name, options, args[1:])  
  File "/home/ben/env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 123, in invoke  
    exit_code = runner.run(args)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 218, in run  
    result = self.command()  
  File "/home/ben/env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/serve.py", line 276, in command  
    relative_to=base, global_conf=vars)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/serve.py", line 313, in loadapp  
    **kw)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 203, in loadapp  
    return loadobj(APP, uri, name=name, **kw)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 223, in loadobj  
    global_conf=global_conf)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 247, in loadcontext  
    global_conf=global_conf)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 270, in _loadconfig  
    return loader.get_context(object_type, name, global_conf)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 397, in get_context  
    global_additions=global_additions)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 492, in _pipeline_app_context  
    APP, pipeline[-1], global_conf)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 401, in get_context  
    section)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 423, in _context_from_use  
    object_type, name=use, global_conf=global_conf)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 353, in get_context  
    global_conf=global_conf)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 247, in loadcontext  
    global_conf=global_conf)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 277, in _loadegg  
    return loader.get_context(object_type, name, global_conf)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 553, in get_context  
    object_type, name=name)  
  File "/home/ben/env/lib/python2.6/site-packages/PasteDeploy-1.3.4-py2.6.egg/paste/deploy/loadwsgi.py", line 573, in find_egg_entry_point  
    pkg_resources.require(self.spec)  
  File "/home/ben/env/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 666, in require  
  File "/home/ben/env/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 565, in resolve  
pkg_resources.DistributionNotFound: MyProject  

我也有PyDev使用virtualenv设置的python解释器。

任何想法可能是什么问题?

以下是截图: screen capture

1 个答案:

答案 0 :(得分:1)

我通过更改pydev中的PYHTONPATH属性来修复此问题,也使用了env / bin。