PsycopgBinary
raw JSON → 0.0.1 verified Fri May 01 auth: no python
A dummy package that re-exports psycopg2-binary for environments where the import name 'psycopg2' is taken or conflicts. Current version 0.0.1. Not actively maintained; use psycopg2-binary directly instead.
pip install psycopgbinary Common errors
error ImportError: No module named psycopgbinary ↓
cause The package name does not match the import name. The module is called psycopg2.
fix
Use import psycopg2 instead of import psycopgbinary.
error ModuleNotFoundError: No module named 'psycopgbinary' ↓
cause You tried to import the package name as a module.
fix
Correct import: import psycopg2
Warnings
gotcha Installing psycopgbinary does NOT provide import psycopgbinary; you must still import psycopg2. The package is just a dependency placeholder. ↓
fix Use import psycopg2. Do not attempt to import psycopgbinary.
deprecated This package is redundant. The official psycopg2-binary package already provides the psycopg2 module. Use pip install psycopg2-binary instead. ↓
fix Uninstall psycopgbinary: pip uninstall psycopgbinary. Then install psycopg2-binary: pip install psycopg2-binary.
Imports
- psycopg2 wrong
import psycopgbinarycorrectimport psycopg2
Quickstart
import psycopg2
conn = psycopg2.connect(database='test', user='postgres', password='secret', host='localhost', port=5432)
cur = conn.cursor()
cur.execute('SELECT 1')
print(cur.fetchone())
cur.close()
conn.close()