-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module import error #45
Comments
Hey @KarlXerri, have you seen #21? Only an app.py is currently supported. |
Thanks Jamie. Hadn't noticed that (the subject was a bit ambiguous). Keeping this bug rep open in case anyone else searches for it. Devs: Feel free to close if you don't deem it worth keeping alive. |
what kind of api only runs from 1 file? the fix should be as easy as setting python path - don't see a reason not to do it. |
As @JamieCressey mentioned, this is being tracked in #21, and there's a pull request from @joel-petersen over at #56, with some good discussion. To summarize, this is something I plan on supporting, we're just in the process of ironing out the details. It would be great to get some feedback over what would work best for you. I'd suggest reading the proposals over in #56 and chime in over what you would prefer. |
In order to separate out of one large app.py file, I want to split related code into helper modules, objects, etc and would expect a structure something like the below (just a rough fag-packet example):
( _ init.py _ _ formatted to avoid markdown parsing)_
When importing a local module using the local python command from within a virtualenv, I can load the modules as you would expect to do, however when I run 'chalice deploy' or 'chalice deploy --no-autogen-policy', I receive an error:
ImportError: No module named blah>
I've tried various structures:
In code I've tried various combinations of import:
None of these will work with deploy, which I'm guessing is due to some introspection logic as it works just as expected using local python command within the python2.7 virtualenv.
I've been on dialog with another developer who also confirms this as being a difficulty he encountered. For the immediate it looks like we'll need to write a kitchen sink app.py, but I'm hoping this is not intended behaviour.
The text was updated successfully, but these errors were encountered: