Loading a Driver
-
Before using the driver, perform the following operations:
- Decompress the driver package of the corresponding version and copy psycopg2 to the site-packagesfolder in the Python installation directory as the rootuser.
- Change the psycopg2directory permission to 755.
- Add the psycopg2directory to the environment variable $PYTHONPATH and validate it.
- For non-database users, configure the lib directory in LD_LIBRARY_PATH after decompression.
-
Load a database driver before creating a database connection:
import psycopg2