2017-03-03 70 views
0

我試圖運行錯誤安裝psycopg2 == 2.6.1

pip install psycopg2==2.6.1 

,但我得到的

In file included from psycopg/psycopgmodule.c:27:0: 
./psycopg/psycopg.h:30:20: fatal error: Python.h: No such file or directory 
compilation terminated. 
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

Failed building wheel for psycopg2 

最後

錯誤
Command "/home/arpan/ArpanMangal/virtualenvmnts/Heroku/heroku-arpan/bin/python 
-u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Hs26Hx/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-Y6fwIc-record/install-record.txt --single-version-externally 
-managed --compile --install-headers /home/arpan/ArpanMangal/virtualenvmnts/ 
Heroku/heroku-arpan/include/site/python2.7/psycopg2" failed with error code 1 
in /tmp/pip-build-Hs26Hx/psycopg2 

我正在安裝psycopg2 = 2.6.1作爲在Heroku上部署我的應用程序的requirment.txt文件的一部分。 有什麼方法可以解決它嗎?

回答

0

您需要安裝以下依賴 sudo apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev

+0

感謝,它爲我工作。 – marpangal