Eclipse / PyDev 运行金字塔development.ini 问题“pkg_resources.DistributionNotFound:”
我从 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:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过更改 pydev 中的 PYHTONPATH 属性以也使用 env/bin 来修复此问题。
I fixed this by changing the PYHTONPATH property in pydev to also use env/bin.