load spaCy in aws lambda function "Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python interpreter from there." #13592
prince-116
started this conversation in
Help: Best practices
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When i try to load spacy using s3 bucket!!
Can any one help me how can i add spacy as a layer in my function?
Steps i followed
Create a virtual environment
python -m venv myenv
Activate the virtual environment
source myenv/bin/activate
Install necessary packages
pip install spacy numpy
python -m spacy download en_core_web_md
Copy packages to the layer directory
cp -r myenv/lib/python3.10/site-packages/* /lambda/volume/python/
then creating zip and uploading to s3 bucket and connecting an new layer
Beta Was this translation helpful? Give feedback.
All reactions