gpt4 book ai didi

python - 为什么在尝试运行 Pyramid 项目时出现 DistributionNotFound 错误?

转载 作者:太空狗 更新时间:2023-10-29 17:44:13 24 4
gpt4 key购买 nike

我在新的 Windows 8 (x64) 中安装了:

  • python-2.7
  • pywin32-218.win32-py2.7
  • setuptools-0.6c11.win32-py2.7
  • 和 Pyramid (通过 easy_install)

我尝试运行我的 Pyramid 项目:

pserve I:\Projects\PyramidProject\development.ini

并且提出了 pkg_resources.DistributionNotFound(req):

traceback

 I:\Projects\MyProject>pserve development.ini Traceback (most recent
call last): File "C:\Python27\Scripts\pserve-script.py", line 9, in
<module>
load_entry_point('pyramid==1.4b1', 'console_scripts', 'pserve')() File
"C:\Python27\lib\site-packages\pyramid-1.4b1-py2.7.egg\pyramid\scripts\ps
erve.py", line 50, in main
return command.run() File "C:\Python27\lib\site-packages\pyramid-1.4b1-py2.7.egg\pyramid\scripts\ps
erve.py", line 301, in run
relative_to=base, global_conf=vars) File "C:\Python27\lib\site-packages\pyramid-1.4b1-py2.7.egg\pyramid\scripts\ps
erve.py", line 332, in loadserver
server_spec, name=name, relative_to=relative_to, **kw) File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
oadwsgi.py", line 255, in loadserver
return loadobj(SERVER, uri, name=name, **kw) File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
oadwsgi.py", line 271, in loadobj
global_conf=global_conf) File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
oadwsgi.py", line 296, in loadcontext
global_conf=global_conf) File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
oadwsgi.py", line 320, in _loadconfig
return loader.get_context(object_type, name, global_conf) File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
oadwsgi.py", line 454, in get_context
section) File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
oadwsgi.py", line 476, in _context_from_use
object_type, name=use, global_conf=global_conf) File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
oadwsgi.py", line 406, in get_context
global_conf=global_conf) File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
oadwsgi.py", line 296, in loadcontext
global_conf=global_conf) File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
oadwsgi.py", line 328, in _loadegg
return loader.get_context(object_type, name, global_conf) File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
oadwsgi.py", line 620, in get_context
object_type, name=name) File "C:\Python27\lib\site-packages\pastedeploy-1.5.0-py2.7.egg\paste\deploy\l
oadwsgi.py", line 640, in find_egg_entry_point
pkg_resources.require(self.spec) File "C:\Python27\lib\site-packages\distribute-0.6.32-py2.7.egg\pkg_resources.
py", line 690, in require
needed = self.resolve(parse_requirements(requirements)) File "C:\Python27\lib\site-packages\distribute-0.6.32-py2.7.egg\pkg_resources.
py", line 588, in resolve
raise DistributionNotFound(req) pkg_resources.DistributionNotFound: Paste

我的开发.ini:

[app:MyProject]
use = egg:MyProject
pyramid.reload_all = true
pyramid.reload_templates = true
pyramid.reload_assets = true
pyramid.debug_all = false
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.debug_templates = true
mako.directories = app:view
mako.module_directory = %(here)s/cache/templates/
#mako.cache_type = file
#mako.cache_enabled = False
#mako.cache_dir = %(here)s/cache/view/
#mako.cache_impl = beaker
#mako.cache_timeout = 60
mako.input_encoding = utf-8
mako.imports = from markupsafe import escape_silent
mako.default_filters = escape_silent
#mako.error_handler =
sqlalchemy.url = mysql://user:mypassword@mysql.mydomain.com/MyProject_dev?charset=utf8
sqlalchemy.pool_recycle = 3600
beaker.session.type = file
beaker.session.cookie_expires = True
beaker.session.cookie_domain = MyProject.pl
beaker.session.data_dir = %(here)s/data/sessions/data
beaker.session.lock_dir = %(here)s/data/sessions/lock
beaker.session.key = MyProject.pl
beaker.session.secret = 57b0d7ff4c665d87e3c3745c2abf519ca7d4082a
beaker.session.validate_key = 57b0d7ff
beaker.cache.enabled = True
beaker.cache.type = memory
beaker.cache.data_dir = %(here)s/cache/data
beaker.cache.lock_dir = %(here)s/cache/lock
beaker.cache.regions = default_term, second_term, minute_term, hour_term, day_term, month_term, short_term, middle_term, long_term,
beaker.cache.second_term.expire = 1
beaker.cache.minute_term.expire = 60
beaker.cache.hour_term.expire = 3600
beaker.cache.day_term.expire = 86400
beaker.cache.month_term.expire = 2678400
beaker.cache.default_term.expire = 60
beaker.cache.short_term.expire = 30
beaker.cache.middle_term.expire = 300
beaker.cache.long_term.expire = 86400
site.front.default_skin = MyProject
site.front.available_skins = default mobile MyProject
default_skin = MyProject
available_skins = default mobile MyProject

[filter:tm]
use = egg:repoze.tm2#tm
commit_veto = repoze.tm:default_commit_veto

[pipeline:main]
pipeline =
egg:WebError#evalerror
tm
MyProject

[server:main]
use = egg:Paste#http
host = 127.0.0.1
port = 5000

# Begin logging configuration

[loggers]
keys = root, MyProject, sqlalchemy

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_MyProject]
level = DEBUG
handlers =
qualname = MyProject

[logger_sqlalchemy]
level = INFO
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither. (Recommended for production systems.)

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

# End logging configuration

你知道吗,我做错了什么?

最佳答案

你需要在你的 virtualenv 中运行 easy_install pastepython setup.py develop

附带说明一下,您使用的是非常旧的 Pyramid 版本。我知道这是因为你的项目使用了 weberror、repoze.tm2 和 paste。如果您有时间,我建议您考虑升级到一些最佳实践。

关于python - 为什么在尝试运行 Pyramid 项目时出现 DistributionNotFound 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13658930/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com