2

I'm attempting to deploy my Pyramid Application on AWS via Elastic Beanstalk. The upload/deploy works fine but when I send a request to the application I'm met with the following error:

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.

...where "MyAppName" is the name of my application (aka the one I've developed and am attempting to use).

From what it looks like, my actual application is not installed during the app deployment. Typically, on a local machine, after developing the application you run:

pip install -e .

in order to install the actual application you are developing. I suppose my question, although it seems silly, is: How do I actually install the application I've written onto the ec2 instance during the upload/deploy process of Elastic Beanstalk? Is there something that should be included in requirements.txt to also install the application in which the requirements.txt exists? Is this done automatically? What am I missing here?

Drew Burnett
  • 607
  • 7
  • 17
  • Can you try "sudo pip install --upgrade setup tools" on your EC2 instance and then try to install the app. – Piyush Patil Jul 16 '16 at 22:48
  • @error2007s Sure. What exactly will upgrading setuptools do? I was hoping for a solution that's already integrated into the chain of event that occurs as a result of using Elastic Beanstalk GUI's upload/deploy button. For example, I'm using a .ebextensions directory and several additional config files to further configure the servers upon environment creation. I was hoping to not have to SSH into the instances and manually configure them each time. Is there a way to locally include the project itself in requirements.txt? – Drew Burnett Jul 16 '16 at 23:21
  • I am guessing it is a version conflict you will not have to do that each time. EB CLI Throws Exceptions VersionConflict. – Piyush Patil Jul 16 '16 at 23:28
  • @error2007s Same problem after updating setuptools. – Drew Burnett Jul 17 '16 at 00:26
  • For the solution, see: http://stackoverflow.com/questions/38426276/deploy-pyramid-application-on-elastic-beanstalk][1] – Drew Burnett Jul 20 '16 at 20:31

0 Answers0