我正试图通过Elastic Beanstalk在AWS上部署我的Pyramid应用程序 . 上传/部署工作正常,但当我向应用程序发送请求时,我遇到以下错误:

File "/opt/python/run/venv/lib/python3.4/site-packages/pkg_resources/__init__.py", line 839, in resolve [Sat Jul 16 21:04:40.351021 2016] [:error] [pid 10837] [remote 76.202.70.172:28102] raise DistributionNotFound(req, requirers) [Sat Jul 16 21:04:40.351110 2016] [:error] [pid 10837] [remote 76.202.70.172:28102] pkg_resources.DistributionNotFound: The 'MyAppName' distribution was not found and is required by the application [Sat Jul 16 21:34:47.346311 2016] [:error] [pid 10837] [remote 76.202.70.172:28102] mod_wsgi (pid=10837): Target WSGI script '/opt/python/current/app/application.py' cannot be loaded as Python module.

...其中"MyAppName"是我的应用程序的名称(也就是我开发并尝试使用的名称) .

从它的外观来看,我的实际应用程序在应用程序部署期间未安装 . 通常,在本地计算机上,在开发应用程序之后运行:

pip install -e .

为了安装您正在开发的实际应用程序 . 我想我的问题虽然看起来很愚蠢但是:我如何在Elastic Beanstalk的上传/部署过程中实际安装我写入ec2实例的应用程序?是否应该在requirements.txt中包含一些内容来安装requirements.txt所在的应用程序?这是自动完成的吗?我在这里错过了什么?