【发布时间】:2016-11-20 10:40:15
【问题描述】:
有人有通过Elastic Beanstalk 安装Pyramid 应用程序的经验吗?我的应用程序已部署,但我无法将应用程序的 application.py(或 pyramid.wsgi)文件配置为正常工作。在get_app 中出现以下错误:
File "/opt/python/run/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 829, in resolve
[Sun Jul 17 21:24:15.482379 2016] [:error] [pid 736] [remote 127.0.0.1:9522] raise DistributionNotFound(req, requirers)
[Sun Jul 17 21:24:15.482427 2016] [:error] [pid 736] [remote 127.0.0.1:9522] DistributionNotFound: The 'MyApp' distribution was not found and is required by the application
MyApp 是我要运行的应用程序。
这是我的application.py:
from pyramid.paster import get_app, setup_logging
import os, site, sys
ini_path = os.path.join(os.path.dirname(__file__), 'production.ini')
setup_logging(ini_path)
application = get_app(ini_path, 'main')
似乎发生错误是因为它在/opt/python/run/venv/lib/python2.7/site-packages/ 中寻找MyApp 而不是/opt/current/python/app/。我错过了什么?我需要在我的路径中添加一些东西吗?
【问题讨论】:
标签: python amazon-web-services deployment amazon-elastic-beanstalk pyramid