error undefined symbol: _Py_ZeroStruct
Hi,
I get the following error while importing netCDF4. I did a pip install netCDF4 -t . Any pointers on how to resolve it?
Function Logs Unable to import module 'test1/lambda_function': /var/task/netCDF4/_netCDF4.so: undefined symbol: _Py_ZeroStruct
On checking /var/task: ec2-user:~/environment/test1 $ ls /var/task ls: cannot access /var/task: No such file or directory
Looks like you have a mismatch between the python interpreter you are using to run the script and the python library that is being linked by _netCDF4.so. Probably one of them is python2.7 and one of them is from python3.x.
It looks like you're trying to run on AWS Lambda. Double check the environment/deployment package for Lambda is being created correctly.