我会做一段时间,我正在做这些事情
? ~ cd ~/project ? project source vProject/bin/activate (vProject)? project cd edu (vProject)? edu pip install pillow Requirement already satisfied (use --upgrade to upgrade): pillow in /home/hadi/project/vProject/lib/python2.7/site-packages
以及我安装psycopg2的那一刻
(vProject)➜edupip install psycopg2
我收到了这个错误
Collecting psycopg2 Using cached psycopg2-2.6.1.tar.gz Building wheels for collected packages: psycopg2 Running setup.py bdist_wheel for psycopg2 Complete output from command /home/hadi/project/vProject/bin/python -c "import setuptools;__file__='/tmp/pip-build-K4RBgE/psycopg2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp_YVqgFpip-wheel-: running bdist_wheel ... In file included from psycopg/psycopgmodule.c:27:0: ./psycopg/psycopg.h:31:22: fatal error: libpq-fe.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for psycopg2 Failed to build psycopg2 Installing collected packages: psycopg2 Running setup.py install for psycopg2 Complete output from command /home/hadi/project/vProject/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-K4RBgE/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-mKANSq-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/hadi/project/vProject/include/site/python2.7/psycopg2: running install running build running build_py running build_ext building 'psycopg2._psycopg' extension gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.1 (dt dec pq3 ext lo64)" -DPG_VERSION_HEX=0x090405 -DHAVE_LO64=1 -I/usr/include/python2.7 -I. -I/usr/include -I/usr/include/pgsql/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-2.7/psycopg/psycopgmodule.o -Wdeclaration-after-statement In file included from psycopg/psycopgmodule.c:27:0: ./psycopg/psycopg.h:31:22: fatal error: libpq-fe.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1 ---------------------------------------- Command "/home/hadi/project/vProject/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-K4RBgE/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-mKANSq-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/hadi/project/vProject/include/site/python2.7/psycopg2" failed with error code 1 in /tmp/pip-build-K4RBgE/psycopg2
我以前安装过gcc
您缺少一个安装它所需的库.我相信你需要安装的软件包postgresql-devel
.