Je voulais en savoir un peu plus sur Pyramid et [Tutorial](http://docs.pylonsproject.org/projects/ pyramid / fr / latest / quick_tutorial / index.html) J'ai essayé. C'est un mémo de la partie trébuchée.
Prelude: Quick Project Startup with Scaffolds
J'avais l'intention de suivre la procédure, mais j'ai eu une erreur.
% pserve development.ini --reload
Starting subprocess with file monitor
Traceback (most recent call last):
File "/usr/local/bin/pserve", line 9, in <module>
load_entry_point('pyramid', 'console_scripts', 'pserve')()
File "/usr/local/lib/python2.7/site-packages/pyramid/scripts/pserve.py", line 60, in main
return command.run()
File "/usr/local/lib/python2.7/site-packages/pyramid/scripts/pserve.py", line 371, in run
global_conf=vars)
File "/usr/local/lib/python2.7/site-packages/pyramid/scripts/pserve.py", line 406, in loadapp
return loadapp(app_spec, name=name, relative_to=relative_to, **kw)
File "/usr/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/usr/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 271, in loadobj
global_conf=global_conf)
File "/usr/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
global_conf=global_conf)
File "/usr/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 320, in _loadconfig
return loader.get_context(object_type, name, global_conf)
File "/usr/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 454, in get_context
section)
File "/usr/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 476, in _context_from_use
object_type, name=use, global_conf=global_conf)
File "/usr/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 406, in get_context
global_conf=global_conf)
File "/usr/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
global_conf=global_conf)
File "/usr/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 328, in _loadegg
return loader.get_context(object_type, name, global_conf)
File "/usr/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 620, in get_context
object_type, name=name)
File "/usr/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 640, in find_egg_entry_point
pkg_resources.require(self.spec)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 968, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 854, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'scaffolds' distribution was not found and is required by the application
La cause était que quelque chose d'autre que la pyramide installée dans virtualenv était utilisé.
% which pserve
/usr/local/bin/pserve
Une fois que j'ai désinstallé la pyramide installée sur mon système et que celle de virtualenv a été utilisée, l'erreur ci-dessus ne s'est plus produite. Voir aussi
% which pserve
/Users/mkisono/.pyenv/shims/pserve
Recommended Posts