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

发布于 2024-10-11 04:34:30 字数 4053 浏览 9 评论 0原文

我从 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 解释器。

有什么想法可能是什么问题吗?

这是一个屏幕截图: 屏幕截图

I'm starting out with the Pyramid framework and trying to run this inside of Eclipse.

My run configuration is:

Main Module: /home/ben/env/bin/paster

Program Arguments: serve /home/ben/dev/python/pyramid/firstPyramid/first/development.ini

This virtualenv paster will serve development.ini fine from the command line. However, running this in eclipse gives:

[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  

I also have PyDev using the python interpreter of the virtualenv setup.

Any ideas what may be the issue?

Here is a screenshot:
screen capture

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谎言月老 2024-10-18 04:34:30

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

I fixed this by changing the PYHTONPATH property in pydev to also use env/bin.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文