If you want to use native libraries in Python's dependent libraries I've heard from a long time ago that the environment to build (pip) and the environment on the AWS Lambda side are aligned.
But what is the actual effect and how is it bad? I haven't checked it at all, so
It is a memo that I checked the library obtained by pip install
while I was addicted to it.
It occurred when using a module that calculates the distance called pyproj
.
(At first, I didn't know what was wrong with this error alone ...)
[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_handler': cannot import name '_datadir' from partially initialized module 'pyproj' (most likely due to a circular import) (/var/task/pyproj/__init__.py)
I do not understand the detailed installation mechanism, but it automatically grasps the environment and It seemed to be downloading the dependent native libraries.
pyproj
- _crs.cpython-37m-x86_64-linux-gnu.so
- _datadir.cpython-37m-x86_64-linux-gnu.so
- proj.py
pyproj
- _crs.cpython-38m-x86_64-linux-gnu.so
- _datadir.cpython-38m-x86_64-linux-gnu.so
- proj.py
pyproj
- _crs.cp37-win32.pyd
- _datadir.cp37-win32.pyd
- proj.py
I got a little more understanding, or a sense of conviction. However, since the official Docker Image of amazon linux is distributed, it may be that the build environment should be there.
Recommended Posts