Edit2:添加了整个stderr
编辑1:删除了我的答案。更新了问题说明并添加了完整的buildout.cfg
文字
编辑0:固定链接
我正在尝试将Pyramid项目移植到Google App Engine。我试图利用托比亚斯·罗达贝尔(谢谢!)buildout recipe来帮助解决这个问题。我使用了pyramid_appengine脚手架,基本上遵循了here描述的过程。
直到我尝试在构建中添加额外的鸡蛋之前,事情进展相对顺利。我尝试将pymongo
包添加到./buildout.cfg
文件
[buildout]
include-site-packages=false
find-links=http://dist.plone.org/thirdparty/
extends = versions.cfg
versions = versions
update-versions-file = versions.cfg
show-picked-versions = true
develop=src/bkk
parts=bkk
tests
service-bkk
ae-sdk-version=1.9.18
ae-runtime=2.7
ae-sdk-location = ${buildout:parts-directory}/google_appengine
ae-extra-paths =
${buildout:bin-directory}
${buildout:directory}/parts/bkk
${buildout:directory}/parts/google_appengine
${buildout:directory}/parts/google_appengine/lib/antlr3
${buildout:directory}/parts/google_appengine/lib/django
${buildout:directory}/parts/google_appengine/lib/fancy_urllib
${buildout:directory}/parts/google_appengine/lib/yaml/lib
unzip=true
supervisor-port = 9999
supervisor-conf-dir = ${buildout:directory}/conf
supervisor-log-dir = ${buildout:directory}/var/log
service-conf-templates = ${buildout:directory}/conf.tmpl
project-name=bkk
[bkk]
recipe=rod.recipe.appengine
packages=
pyramid
pymongo
pyramid_jinja2
repoze.lru
zope.interface
zope.deprecation
venusian
translationstring
jinja2
webob
src=src/bkk
server-script=devappserver
zip-packages=false
use_setuptools_pkg_resources=true
url=https://storage.googleapis.com/appengine-sdks/featured/google_appengine_${buildout:ae-sdk-version}.zip
[bootstrap]
recipe=zc.recipe.egg
eggs=pastescript
extra-paths=${buildout:ae-extra-paths}
[tests]
recipe = zc.recipe.egg
eggs =
WebTest
WebOb
pytest
pytest-cov
interpreter = python
extra-paths=${buildout:ae-extra-paths}
[supervisor]
recipe = zc.recipe.egg
[mk-supervisor-log-dir]
recipe = collective.recipe.cmd:py
on_install = true
cmds =
>>> if not os.path.isdir('${buildout:supervisor-log-dir}'):os.makedirs('${buildout:supervisor-log-dir}')
[service-supervisor]
recipe = collective.recipe.template
input = ${buildout:service-conf-templates}/supervisord.conf_tmpl
output = ${buildout:directory}/etc/supervisord.conf
depends = ${mk-supervisor-log-dir:recipe} ${supervisor:recipe}
[service-bkk]
recipe = collective.recipe.template
input = ${buildout:service-conf-templates}/service-${buildout:project-name}.conf_tmpl
output = ${buildout:supervisor-conf-dir}/service-${buildout:project-name}.conf
port=8000
admin_port=8010
api_port=8020
depends = ${service-supervisor:recipe}
并将相应的egg解压缩到./eggs
目录中。我最终收到以下错误:
Develop: '/Users/npk1/Dev/bkk/bkk_gae/bkk/src/bkk'
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'paster_plugins'
warnings.warn(msg)
warning: no files found matching '*.ini'
warning: no files found matching '*.rst'
warning: no files found matching '*.jpg' under directory 'bkk'
warning: no files found matching '*.pt' under directory 'bkk'
warning: no files found matching '*.txt' under directory 'bkk'
warning: no files found matching '*.mak' under directory 'bkk'
warning: no files found matching '*.mako' under directory 'bkk'
warning: no files found matching '*.js' under directory 'bkk'
warning: no files found matching '*.html' under directory 'bkk'
warning: no files found matching '*.xml' under directory 'bkk'
Uninstalling bkk.
Unused options for buildout: 'ae-runtime' 'include-site-packages' 'unzip'.
Installing bkk.
rod.recipe.appengine: Google App Engine distribution already downloaded.
While:
Installing bkk.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/Users/npk1/Dev/bkk/bkk_gae/bkk/eggs/zc.buildout-2.3.1-py2.7.egg/zc/buildout/buildout.py", line 1946, in main
getattr(buildout, command)(args)
File "/Users/npk1/Dev/bkk/bkk_gae/bkk/eggs/zc.buildout-2.3.1-py2.7.egg/zc/buildout/buildout.py", line 626, in install
installed_files = self[part]._call(recipe.install)
File "/Users/npk1/Dev/bkk/bkk_gae/bkk/eggs/zc.buildout-2.3.1-py2.7.egg/zc/buildout/buildout.py", line 1370, in _call
return f()
File "/Users/npk1/Dev/bkk/bkk_gae/bkk/eggs/rod.recipe.appengine-2.0.6-py2.7.egg/rod/recipe/appengine/__init__.py", line 380, in install
self.copy_packages(ws, temp_dir)
File "/Users/npk1/Dev/bkk/bkk_gae/bkk/eggs/rod.recipe.appengine-2.0.6-py2.7.egg/rod/recipe/appengine/__init__.py", line 290, in copy_packages
raise KeyError, '%s: package not found.' % p
KeyError: 'pyramid_jinja2: package not found.'
在代码中,似乎zc.recipe
正在组装自己的依赖项列表,并根据我的项目检查它们,并且pymongo
没有显示,但可能我错了。
有没有人知道将新包添加到现有配方时的过程?这是错误的思考方式吗?我将继续尝试消化buildout的文档,因为我是该实用程序的新手。
由于
答案 0 :(得分:0)
金字塔有cookbook of recipes。
这两个方案描述了如何在GAE上部署Pyramid。两者都使用与您开始的路径不同的方法提供指导。