dnachisel not working on AWS Lambda
See original GitHub issueImporting the library doesn’t seem to work in AWS Lambda.
Something like the following:
import dnachisel as dc
def lambda_handler(event, context):
return "test"
When run on lambda throws:
{
"errorMessage": "Unable to import module 'lambda_function': cannot import name '_aligners' from partially initialized module 'Bio.Align' (most likely due to a circular import) (/var/task/Bio/Align/__init__.py)",
"errorType": "Runtime.ImportModuleError",
"stackTrace": []
}
Everything works fine if I mock the lambda locally. I uploaded the lambda code and the dependencies as a zip file, but also tried uploading dnachisel as a lambda layer and got the same error.
Python version: 3.8 dnachisel version: 3.2.9
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
DNA Chisel - a versatile sequence optimizer
DNA Chisel (complete documentation here) is a Python library for optimizing DNA sequences with respect to a set of constraints and optimization objectives....
Read more >Operating Lambda: Isolating and resolving issues
This post walks through troubleshooting application issues in an example walkthrough and monitoring Lambda code storage usage.
Read more >dnachisel - PyPI
DNA Chisel (complete documentation here) is a Python library for optimizing DNA sequences with respect to a set of constraints and optimization objectives....
Read more >multiprocessing.SemLock is not implemented when running ...
As far as I can tell, multiprocessing won't work on AWS Lambda because the execution environment/container is missing /dev/shm - see ...
Read more >Our summer 2019 interns and their adventures in DNA ...
To make this work, I integrated the open-source DNA Chisel library into Benchling ... Our custom integrations are deployed on AWS Lambda, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately we can’t use code build as it would imply changing the whole infrastructure of our project. However, you are right, the problem is with biopython. I tried the following code and got the same issue.
Thank you!
I have one more suggestion. I believe this problem is not related to DNA Chisel, but Biopython.
When we import
/site-packages/Bio/Align/__init__.py
it starts withwhich is the line that causes problem according to your error. This is an .so file, and these discussions suggest “Problem is solved by deploying the package through AWS codeBuild”:
https://stackoverflow.com/questions/64450587/error-trying-to-import-pysftp-in-lambda-cannot-import-name-bcrypt-from-parti
https://github.com/pymupdf/PyMuPDF/issues/430#issuecomment-576231408