You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to deploy a django application that depends on the docutils package, the following error is raised by the Django application:
Request Method: | GET
-- | --
https://....execute-api.us-east-1.amazonaws.com/dev/
3.0.1
ModuleNotFoundError
No module named 'docutils'
/tmp/.../readme_renderer/rst.py in <module>, line 18
/var/lang/bin/python3.8
3.8.6
['/tmp/expi', '/var/task', '/opt/python/lib/python3.8/site-packages', '/opt/python', '/var/runtime', '/var/lang/lib/python38.zip', '/var/lang/lib/python3.8', '/var/lang/lib/python3.8/lib-dynload', '/var/lang/lib/python3.8/site-packages', '/opt/python/lib/python3.8/site-packages', '/opt/python', '/var/task']
Context
I did my best to figure out why: rebuilt my virtual environments from scratch, updated my package versions, moved from Python 3.6 to Python 3.8. The issue persisted: whenever I opened the zip file the package was missing.
I tried copying the docutils directory from my virtual environment to the root of my project, so it would be in the root of the zip. It still wouldn't show up.
197 # We never need to include these.
198 # Related: https://github.com/Miserlou/Zappa/pull/56
199 # Related: https://github.com/Miserlou/Zappa/pull/581
200 ZIP_EXCLUDES = [
201 '*.exe', '*.DS_Store', '*.Python', '*.git', '.git/*', '*.zip', '*.tar.gz',
202 '*.hg', 'pip', 'docutils*', 'setuputils*', '__pycache__/*'
203 ]
Thanks for providing context: reviewing the pull requests it looks like docutils should exist in the lambda environment without being included in the zappa package. However, it doesn't appear to be in my lambda environment.
I am not clear is this is me mis-configuring things, choosing bad versions, or that something has changed and the package is in fact no longer available.
All the environment setup has been handled by Zappa. Other than creating an execution policy and IAM user, zappa has done it all.
This is the third project I am deploying with zappa and it is awesome - it has saved me much time and many headaches while also helping me learn about AWS in a more structured way than I would have otherwise. Thank you.
Expected Behavior
Python applications should be able to depend on, and use, the docutils package in a zappa deployed lambda environment.
Actual Behavior
The docutils module cannot be found in the zappa created lambda environment.
Possible Fix
I have been trying to find a list from Amazon of the packages included by default in the lambda environment but haven't been successful. If docutils is not included (i.e. it isn't just me), removing the "docutils*" entry from ZIP_EXCLUDES solves the problem. I have confirmed this in my environment.
If it is just me, it would be nice if these excludes were documented somewhere other than the pull request (which wasn't hitting my web searches); I thought I was going crazy with docutils not appearing in the package.
Steps to Reproduce
Create a new function that import docutils and returns success.
Deploy the function using zappa deploy dev.
Visit the endpoint (or look at the touch results) - > result 500
Your Environment
Zappa version used: zappa --version 0.52.0
Operating System and Python version: Mac OSX 10.13.6 - Python 3.8.5
When trying to deploy a django application that depends on the docutils package, the following error is raised by the Django application:
Context
I did my best to figure out why: rebuilt my virtual environments from scratch, updated my package versions, moved from Python 3.6 to Python 3.8. The issue persisted: whenever I opened the zip file the package was missing.
I tried copying the docutils directory from my virtual environment to the root of my project, so it would be in the root of the zip. It still wouldn't show up.
Eventually I went looking in the Zappa source:
Which leads to core.py:
Thanks for providing context: reviewing the pull requests it looks like docutils should exist in the lambda environment without being included in the zappa package. However, it doesn't appear to be in my lambda environment.
I am not clear is this is me mis-configuring things, choosing bad versions, or that something has changed and the package is in fact no longer available.
All the environment setup has been handled by Zappa. Other than creating an execution policy and IAM user, zappa has done it all.
This is the third project I am deploying with zappa and it is awesome - it has saved me much time and many headaches while also helping me learn about AWS in a more structured way than I would have otherwise. Thank you.
Expected Behavior
Python applications should be able to depend on, and use, the docutils package in a zappa deployed lambda environment.
Actual Behavior
The docutils module cannot be found in the zappa created lambda environment.
Possible Fix
I have been trying to find a list from Amazon of the packages included by default in the lambda environment but haven't been successful. If docutils is not included (i.e. it isn't just me), removing the
"docutils*"
entry fromZIP_EXCLUDES
solves the problem. I have confirmed this in my environment.If it is just me, it would be nice if these excludes were documented somewhere other than the pull request (which wasn't hitting my web searches); I thought I was going crazy with docutils not appearing in the package.
Steps to Reproduce
import docutils
and returns success.Your Environment
zappa --version 0.52.0
pip freeze
:zappa_settings.json
:The text was updated successfully, but these errors were encountered: