would like to use psycopg2 package in python script. Cannot seem to load it.
i loaded this
pip install psycopg2-binary
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: psycopg2-binary in /usr/local/lib64/python3.6/site-packages (2.7.5)
getting this
File “/home/adm_bbyers6/rrd_get/scripts/postgres_crud.py”, line 4, in
import psycopg2
ImportError: No module named psycopg2
this “pip install psycopg2”
pip install psycopg2-binary
gives me this problem
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong –param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSYCOPG_VERSION=2.9.8 (dt dec pq3 ext) -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=90224 -DPSYCOPG_DEBUG=1 -I/usr/include/python3.6m -I. -I/usr/include -I/usr/include/pgsql/server -I/usr/include/libxml2 -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:28:0:
./psycopg/psycopg.h:35:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
Brett Byers is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.