serverless/serverless-python-requirements

Cryptography not appearing even though it's in requirements.txt?

vineetparikh opened this issue · 3 comments

For context, while my requirements.txt file (for a Flask application deployed in a Lambda function) has cryptography, I'm still getting the error

NotImplementedError: Algorithm 'RS256' could not be found. Do you have cryptography installed? 

and as a result I can't use PyJWT, which is necessary for a higher-level dependency. This is despite the fact that I have cryptography installed and present in my requirements.txt file. What's going on here?

Hey any updates?

Hey @vineetparikh - are you able to post a small reproducible example? Maybe the solution to your problem is somewhere here: jpadilla/pyjwt#181? It's possible that the problem is not related to the plugin at all

Just browsing through issues and perhaps I can shed some light to anyone stumbling upon this. Not sure if it applies to your specific issue, though. I've run into this issue with cryptography / cffi in the past when deploying from windows/mac. The following configuration helps:

custom:
  pythonRequirements:
    dockerizePip: non-linux