Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

ImportError: DLL load failed while importing _psycopg: The specified module could not be found. #66

Open
visch opened this issue Feb 3, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@visch
Copy link

visch commented Feb 3, 2022

Describe the bug
ImportError: DLL load failed while importing _psycopg: The specified module could not be found.

To Reproduce
Steps to reproduce the behavior:

  1. On windows install the target with pip
  2. Run the target, you'll get this error

To fix this:

  1. On the same venv as target-postgres install both psycopg2-binary psycopg2 (Not certain both are needed), everything works.

Python version 3.9.9

@visch visch added the bug Something isn't working label Feb 3, 2022
@visch
Copy link
Author

visch commented Apr 12, 2022

The other way I ran it was without psycopg2-binary and only psycop2 because of this little bit I found in the documentation for psycop2.
The psycopg2-binary package is meant for beginners to start playing with Python and PostgreSQL without the need to meet the build requirements.
If you are the maintainer of a published package depending on psycopg2 you shouldn't use psycopg2-binary as a module dependency. For production use you are advised to use the source distribution.
https://www.psycopg.org/docs/install.html#psycopg-vs-psycopg-binary

From Dan Norman on Meltano slack

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant