Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: undefined symbol: PQencryptPasswordConn #1093

Closed
AndreFCruz opened this issue Apr 28, 2020 · 3 comments
Closed

ImportError: undefined symbol: PQencryptPasswordConn #1093

AndreFCruz opened this issue Apr 28, 2020 · 3 comments

Comments

@AndreFCruz
Copy link

AndreFCruz commented Apr 28, 2020

While using sqlalchemy on a remote computer I ran into this ImportError (which Ican get just by running import psycopg2):
image

Python is running on a conda environment, which was packed (conda pack) scped and unpacked (conda-unpack) into the remote computer.
Python packages are on ~/<conda-env>/lib/python3.7/site-packages

I have these psycopg packages installed from pypi:

psycopg2==2.8.5
psycopg2-binary==2.8.5

I have seen this issue #1018 but cannot seem to solve it by installing from source as that user did.

Am I missing any dependency?

Thanks :)

@dvarrazzo
Copy link
Member

PQencryptPasswordConn is available in libpq 10. If psycopg is built with a previous version than the functionality is not compiled in and the library will just give an error if the feature is used.

In your case psycopg was built on a system with a pg_config >= 10 and then moved on a system which at runtime has libpq < 10

I don't believe this is possible with wheels, because they ship with the libpq used at build time and it is > 10.

I don't know what conda pack and unpack do, but they are not doing it right. Please open a bug with them, pointing them to this bug for explanations.

@AndreFCruz
Copy link
Author

Thanks

As a quick fix I can report that downgrading psycopg2 and sqlalchemy to the following versions fixed the problem:

psycopg2-binary==2.8.4
SQLAlchemy==1.3.15

@liangxu21
Copy link

psycopg2-binary==2.8.4
SQLAlchemy==1.3.15

works for me. thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants