Skip to content
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

Unable to import module 'wsgi': No module named 'werkzeug' #80

Closed
babyhuey opened this issue Jan 14, 2019 · 8 comments
Closed

Unable to import module 'wsgi': No module named 'werkzeug' #80

babyhuey opened this issue Jan 14, 2019 · 8 comments

Comments

@babyhuey
Copy link

Suddenly getting this error again on v1.6.1

Rolling back to 1.6.0 fixes the issue

@logandk
Copy link
Owner

logandk commented Jan 15, 2019

Are you using serverless-python-requirements?

@babyhuey
Copy link
Author

Yes I am.

@logandk
Copy link
Owner

logandk commented Jan 15, 2019

And you have werkzeug in your requirements.txt? There's no change in 1.6.0 -> 1.6.1 that should cause and import error for werkzeug. I'd recommend unzipping the zip bundle that is uploaded to lambda and verify that werkzeug is present.

@babyhuey
Copy link
Author

No, I don't have it in my requirements. In the past is was automatically installed.

I just pulled down my packages and unzipped. 1.6.1 has no werkzeug package installed, but the install from 1.5.3 does

@babyhuey
Copy link
Author

I also just realized that I said 1.6.0 originally, when I rolled back to 1.5.3.

So I'm guessing that it is from this change?
Detect presence of serverless-python-requirements and disable packRequirements automatically

If so, documentation should probably be updated saying to add werkzeug to requirements if using python-serverless-requirements plugin

@logandk
Copy link
Owner

logandk commented Jan 15, 2019

Right, then you probably didn't have packRequirements set to false before, meaning that both serverless-wsgi and serverless-python-requirements were installing your pip packages (and only serverless-wsgi always makes sure to include werkzeug).

I agree that this should be added to the documentation, will keep the issue open until this is completed.

@eml-nx
Copy link

eml-nx commented May 19, 2021

I found this in stackoverflow and it works I downgrade Flask to 1.1.4

Flask, Werkzeug and other pallets projects just had a major update, dropping python2 support and deleting _compat module. And AWS has't resolve the capability issue yet.
The simplest fix will be downgrading Flask, Werkzeug, etc. to the previous major version.

Credits to Allan Chain

@mohammad-aqajani
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants