2012-10-16 110 views
3

我使用pipeasy_install无法在centos上安装psycopg2

我得到这个错误信息:

Downloading/unpacking psycopg2 

Running setup.py egg_info for package psycopg2 

error: invalid Python installation: unable to open /usr/include/python2.6/pyconfig.h (No such file or directory) 

Complete output from command python setup.py egg_info: 

running egg_info 

writing pip-egg-info/psycopg2.egg-info/PKG-INFO 

writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt 

writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt 

warning: manifest_maker: standard file '-c' not found 

error: invalid Python installation: unable to open /usr/include/python2.6/pyconfig.h (No such file or directory) 

---------------------------------------- 
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/psycopg2 

Storing complete log in /root/.pip/pip.log 

真的需要你的帮助家伙..

回答

10

编辑:我读为 'pgconfig',而不是 'pyconfig' 首次周围。

如果您缺少pyconfig.h,那么您可能会错过Python开发包。

尝试到yum install python-devel,然后再次安装psycopg2。

(您仍然需要在postgresql-devel包为好,如果你没有这样做安装)

+0

我做到了。但是当我试图查看/usr/include/python2.6时,没有文件夹python2.6。 我只在/ usr/bin /中有python2.6文件夹,我该怎么办? –

+0

查看对此文章的修改;它不是postgresql-devel,你可能会丢失,但python-devel。 –

+0

只需安装“yum install postgresql-devel”并尝试重新安装PSYCOPG2再次 – Transformer