โค้ด: เลือกทั้งหมด
(venv) com001@com001-K45A:~/PycharmProjects/htmltoPdfImage$ pip install psycopg2
Collecting psycopg2
Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
Complete output from command /home/com001/PycharmProjects/htmltoPdfImage/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-850ojqpk/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-jwpix0hj/install-record.txt --single-version-externally-managed --compile --install-headers /home/com001/PycharmProjects/htmltoPdfImage/venv/include/site/python3.5/psycopg2:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.5/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.5/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.5/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.5/psycopg2
copying lib/compat.py -> build/lib.linux-x86_64-3.5/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-3.5/psycopg2
copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.5/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.5/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.5/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.5/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.5/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.5/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.5/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/psycopg
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=90518 -DHAVE_LO64=1 -I/home/com001/PycharmProjects/htmltoPdfImage/venv/include -I/usr/include/python3.5m -I. -I/usr/include/postgresql -I/usr/include/postgresql/9.5/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.5/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:27:0:
./psycopg/psycopg.h:34:20: fatal error: Python.h: No such file or directory
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/com001/PycharmProjects/htmltoPdfImage/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-850ojqpk/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-jwpix0hj/install-record.txt --single-version-externally-managed --compile --install-headers /home/com001/PycharmProjects/htmltoPdfImage/venv/include/site/python3.5/psycopg2" failed with error code 1 in /tmp/pip-install-850ojqpk/psycopg2/