Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

No module named pyasn1.codec.der

Open
#41 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
aws, cryptography, python

Research direction

Inspect lambda_packages/cryptography and the extracted cryptography-1.4.tar.gz contents first; then reproduce the AWS Lambda deployment using the described CloudFormation package and check the CloudWatch import error. Done means the deployed function imports cryptography without the pyasn1.codec.der error.

Written by the indexing model from the issue text.

Description

Hello.
So, I've been trying to include one of the libs from lambda-packages, and failed repeatedly :(

I'm hitting on the error in the title:

No module named pyasn1.codec.der

Specifically, I'm trying to get the cryptography module into my lambda deployment packages, but maybe I'm misunderstanding the quick guide:

But, if you want to use this project the other (wrong) way, just put the contents of the .tar.gz archive into your lambda .zip.

Yes, I'm sorry, but I can't jump on Zappa at this point (maybe after this proof of concept is done), but it seems like I shouldn't have to, right?

So.. working on a Mac, I:

  • downloaded lambda-packages-master.zip, extracted its contents
  • dug into \lambda_packages\cryptography,
  • grabbed and extracted (to libs-for-aws\cryptography ) the cryptography-1.4.tar.gz archive.

Then I built my Lambda Deployment Package, and added to it the libs-for-aws\cryptography directory.

Package via Cloud Formation, deploy to AWS, and, when my Lambda is triggered, I get a 500, and in CloudWatch logs I get this message (cauth is just the name of my Lambda package)

START RequestId: 938e62f0-18a2-11e7-a55f-d146b6ce0af9 Version: $LATEST
Unable to import module 'cauth': No module named pyasn1.codec.der
END RequestId: 938e62f0-18a2-11e7-a55f-d146b6ce0af9

Am I doing something wrong in the way I'm trying to include the cryptography package from lambda-packages?

Dominant language
Shell
Stars
728
Forks
157
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Miserlou/lambda-packages

All issues in Miserlou/lambda-packages

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.