Does anyone have experience installing a Pyramid application via Elastic Beanstalk? My application deploys but I cannot configure the application's application.py (or pyramid.wsgi) file to work properly. Within get_app the following error occurs:
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
Where MyApp is the application I am trying to run.
Here is my 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')
It seems as though the error occurs because its looking for MyApp within /opt/python/run/venv/lib/python2.7/site-packages/ rather than /opt/current/python/app/. What am I missing? Do I need to add something to my path? Does anyone have experience with this?
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/94579979-dedf-4743-8f05-3d79e52a9a3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
It might be that if you have a requirements.txt that Beanstalk only installs that and not your package. Listing your package as an in place, editable install with an entry like "-e ." in the requirements file will make sure that your package is linked into the environment.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwGgH8_-ML8dHONJ909HFGepmMXT9XsU82n6n_HWy1c8Bw%40mail.gmail.com.
Next, run the `eb deploy` command. Elastic Beanstalk should now recognize that your package is installed.container_commands:01_setup:command: "/opt/python/run/venv/bin/python setup.py develop"
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAAL6JQg7FsYJDP55qUzFsGbwLRRF85mOojMLEmPt0Mb8yROSWw%40mail.gmail.com.
You're a savior! I can't tell you how appreciate I am. What a bonehead move on my part, leaving out that command; nevertheless, adding the `setup.py develop` call in .ebextension did the trick!
I had tried that previously but was met with the error:
'failed, because: Directory '.' is not installable. File 'setup.py' not found.'
Which I didn't understand because requirements.txt exists in the root directory of the project, at the same level as setup.py. Any ideas?
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwGCNS9xFx6Ln0rsZ8tNXNdZLeR49wrrR43m%3D_y5Q7J23Q%40mail.gmail.com.
[Wed Dec 07 05:42:22.567889 2016] [:error] [pid 3438] [remote 127.0.0.1:55221] ImportError: No module named 'zope.deprecation'
[Wed Dec 07 05:42:23.572279 2016] [:error] [pid 3438] [remote 127.0.0.1:59573] mod_wsgi (pid=3438): Target WSGI script '/opt/python/current/app/application.py' cannot be loaded as Python module.
[Wed Dec 07 05:42:23.572326 2016] [:error] [pid 3438] [remote 127.0.0.1:59573] mod_wsgi (pid=3438): Exception occurred processing WSGI script '/opt/python/current/app/application.py'.
[Wed Dec 07 05:42:23.572355 2016] [:error] [pid 3438] [remote 127.0.0.1:59573] Traceback (most recent call last):
[Wed Dec 07 05:42:23.572396 2016] [:error] [pid 3438] [remote 127.0.0.1:59573] File "/opt/python/current/app/application.py", line 1, in <module>
[Wed Dec 07 05:42:23.572402 2016] [:error] [pid 3438] [remote 127.0.0.1:59573] from pyramid.paster import get_app, setup_logging
[Wed Dec 07 05:42:23.572424 2016] [:error] [pid 3438] [remote 127.0.0.1:59573] File "/opt/python/run/venv/lib/python3.4/site-packages/pyramid/paster.py", line 10, in <module>
[Wed Dec 07 05:42:23.572428 2016] [:error] [pid 3438] [remote 127.0.0.1:59573] from pyramid.scripting import prepare
[Wed Dec 07 05:42:23.572447 2016] [:error] [pid 3438] [remote 127.0.0.1:59573] File "/opt/python/run/venv/lib/python3.4/site-packages/pyramid/scripting.py", line 1, in <module>
[Wed Dec 07 05:42:23.572450 2016] [:error] [pid 3438] [remote 127.0.0.1:59573] from pyramid.config import global_registries
[Wed Dec 07 05:42:23.572469 2016] [:error] [pid 3438] [remote 127.0.0.1:59573] File "/opt/python/run/venv/lib/python3.4/site-packages/pyramid/config/__init__.py", line 12, in <module>
[Wed Dec 07 05:42:23.572473 2016] [:error] [pid 3438] [remote 127.0.0.1:59573] from pyramid.interfaces import (
[Wed Dec 07 05:42:23.572490 2016] [:error] [pid 3438] [remote 127.0.0.1:59573] File "/opt/python/run/venv/lib/python3.4/site-packages/pyramid/interfaces.py", line 1, in <module>--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/fb78a2c5-5073-4fe3-8887-720791b26700%40googlegroups.com.
beautifulsoup4==4.5.1Chameleon==2.25coverage==4.2Mako==1.0.6MarkupSafe==0.23PasteDeploy==1.5.2py==1.4.31Pygments==2.1.3pyramid==1.7.3pyramid-chameleon==0.3pyramid-debugtoolbar==3.0.5pyramid-mako==1.0.2pytest==3.0.5pytest-cov==2.4.0repoze.lru==0.6six==1.10.0translationstring==1.3venusian==1.0waitress==1.0.1WebOb==1.6.3WebTest==2.0.23zope.deprecation==4.2.0zope.interface==4.3.2To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
container_commands:01_setup:command: "/opt/python/run/venv/bin/python setup.py develop"
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/2367b0c1-062c-4e56-84e8-f9f178448ee0%40googlegroups.com.