jkehler / awslambda-psycopg2

1.12k stars 363 forks source link

undefined symbol: _PyInterpreterState_Get (with psycopg2-3.7) #55

Closed matthewhegarty closed 4 years ago

matthewhegarty commented 4 years ago

Many thanks for producing this library.

I got the following error when using the psycopg2-3.7 library. I copied and renamed as per the instructions (I noticed all files were executable with perm 755 which is different to the psycopg2-3.6 version).

{"errorMessage": "Unable to import module 'db_test': /var/task/psycopg2/_psycopg.so: undefined symbol: _PyInterpreterState_Get", "errorType": "Runtime.ImportModuleError"}

The solution for me was to switch to the 3.6 version of the library, which worked fine.

jkehler commented 4 years ago

A 3.7 build was just merged in. Can you try again with that.

matthewhegarty commented 4 years ago

Yes - I tried with the new build and it worked fine. Thanks

btw - I notice that some of the files still have executable permissions, perhaps only the binary needs to be executable?:

Update: Have created a PR to alter the permissions to be the same as for the 3.6 lib.

-rw-r--r-- 1 matthew matthew     367 Apr 17 16:01 compat.py
-rwxr-xr-x 1 matthew matthew   13532 Apr 17 16:01 errorcodes.py
-rw-r--r-- 1 matthew matthew    1382 Apr 17 16:01 errors.py
-rwxr-xr-x 1 matthew matthew    7084 Apr 17 16:01 extensions.py
-rwxr-xr-x 1 matthew matthew   43756 Apr 17 16:01 extras.py
-rwxr-xr-x 1 matthew matthew    4892 Apr 17 16:01 __init__.py
-rwxr-xr-x 1 matthew matthew    2929 Apr 17 16:01 _ipaddress.py
-rwxr-xr-x 1 matthew matthew    7258 Apr 17 16:01 _json.py
-rw-r--r-- 1 matthew matthew    4261 Apr 17 16:01 _lru_cache.py
-rwxr-xr-x 1 matthew matthew    6281 Apr 17 16:01 pool.py
-rwxr-xr-x 1 matthew matthew    3329 Mar 11 11:19 psycopg1.py
-rwxr-xr-x 1 matthew matthew 1478600 Apr 17 16:01 _psycopg.cpython-37m-x86_64-linux-gnu.so
-rwxr-xr-x 1 matthew matthew   17667 Apr 17 16:01 _range.py
-rwxr-xr-x 1 matthew matthew   14865 Apr 17 16:01 sql.py
-rwxr-xr-x 1 matthew matthew    4408 Apr 17 16:01 tz.py