Trying to Import a Module: Undefined Symbol: Pyunicodeucs4_Decodeutf8

trying to import a module: undefined symbol: PyUnicodeUCS4_DecodeUTF8

The module was built against a Python that was built with UCS-4 as its internal unicode representation. Your Python was built with UCS-2 as its internal representation. Rebuild the module, or rebuild Python.

This issue is mentioned in the official FAQ. This is discussed in-depth in python issue 8654.

python : undefined symbol: PyUnicodeUCS2_DecodeUTF8

You are using a different Python interpreter for running your code than the one used to compile scipy. This usually occurs with a Python installation compiled with Unicode UCS2 support running modules compiled against a Python installation with Unicode UCS4 support (or vis versa). You need to recompile/reinstall the scipy installation with exact the Python interpreter used for running your code.

undefined symbol: PyUnicodeUCS2_Decode whilst trying to install psycopg2

fixed it.

I had to recompile python with --enable-unicode=ucs4.

Still not clear why as the default version on ubuntu uses ucs4.

AWS Lambda issue with psycopg2

I ran into this issue as well when trying to upload the .zip containing my Lambda. The issue for me was that I was compressing my Lambda from one directory above.

The solution was running the zip command within the directory containing the Lambda function itself as opposed to running zip from its parent directory.

For example, if your lambda function exists within the directory ~/lambda as lambda_function.py along with any additional libraries (i.e. multiprocessing) - you should zip your Lambda Deployment Package by doing the following.

$ cd ~/lambda
$ zip lambda_function.zip lambda_function.py
$ zip -r lambda_function.zip multiprocessing*

Uploading the resulting .zip file should resolve this issue.



Related Topics



Leave a reply



Submit