-
Notifications
You must be signed in to change notification settings - Fork 290
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_handler': No module named 'werkzeug' #469
Comments
Been seeing this too |
same here... |
Same here |
The same! |
Can you guys rollback and version pin your version of serverless wsgi and make sure to be using the latest version of this plugin and try again? I suspect it is the plugin. I will do some testing of my own shortly. |
Mine was a false alarm, provided by not pointing to the correct requirements.txt, so all clear here even with the new version. |
did somebody find a way to fix this? |
I found this in stackoverflow and it works I downgrade Flask to 1.1.4
|
For anyone here, this is solved since version 2.0.0. Run |
(take care this message means that aws lambda does not load any packages as layer) for mine: Output: |
Facing the same issue, anyone found a solution? |
Could you share more context about your specific setup @victorstefan13? Are you using Flask or a similar framework? If yes, what version? |
So I managed to fix this. I think the issue was actually related to our deployment pipelines. I went down the route of pre-packing the app by creating a package directory and installing the python requirements within that directory - |
Bug Report: Serverless Offline Missing WSGI Files Title: sls offline fails to create required WSGI files Severity: High Environment:
Description: Steps to Reproduce:
Expected: Workaround: |
Hey @alex-morgun - that should probably be reported within |
Hello, thanks, this is number one link in a google, so this is a way how to fix it. It's not an actual issue filled. Bu t thanks for an idea. |
I keep getting this error in my AWS logs when trying to deploy using serverless:
Unable to import module 'wsgi_handler': No module named 'werkzeug'
It seems that the zip folder containing the app does not contain the right packages as specified in my requirements.txt and there is no .requirements folder either.
I have explicitly specified werkzeug in my requirements .txt and yet this package cannot be installed.
My serverless .yml:
service: serverless-flask
plugins:
custom:
tableName: 'transactions-table-${self:provider.stage}'
wsgi:
app: app.app # entrypoint is app.app, which means the app object in the app.py module.
packRequirements: false
pythonRequirements:
dockerizePip: true
dynamodb:
stages:
start:
migrate: true
provider:
name: aws
runtime: python3.6
stage: dev
region: us-east-1
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
Resource:
- { "Fn::GetAtt": ["TransactionsDynamoDBTable", "Arn" ] }
environment:
TRANSACTIONS_TABLE: ${self:custom.tableName}
functions:
app:
handler: wsgi_handler.handler
events:
- http: ANY /
- http: 'ANY {proxy+}'
resources:
Resources:
TransactionsDynamoDBTable:
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
-
AttributeName: transactionId
AttributeType: S
-
AttributeName: timestamp
AttributeType: S
KeySchema:
-
AttributeName: transactionId
KeyType: HASH
-
AttributeName: timestamp
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: ${self:custom.tableName}
My requrements.txt :
boto3==1.11.17
botocore==1.14.17
Click==7.0
docutils==0.15.2
Flask==1.1.1
itsdangerous==1.1.0
Jinja2==2.11.1
jmespath==0.9.4
MarkupSafe==1.1.1
python-dateutil==2.8.1
s3transfer==0.3.3
six==1.14.0
urllib3==1.25.8
Werkzeug==1.0.0
Any ideas what I'm doing wrong here?
The text was updated successfully, but these errors were encountered: