【问题标题】:install pg_config in CentOS 5.5 without yum在没有 yum 的 CentOS 5.5 中安装 pg_config
【发布时间】:2012-03-24 21:36:14
【问题描述】:

python 2.4 版

# pip install psycopg2

得到以下错误:

下载/解压 psycopg2 为包 psycopg2 运行 setup.py egg_info

Error: pg_config executable not found.

Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.
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: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /root/sources/build/psycopg2
Storing complete log in /root/.pip/pip.log
[root@host sources]# which pg_config
/usr/bin/which: no pg_config in     (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/b    in:/root/bin)

我无法将 pg_config 安装为可执行文件

【问题讨论】:

    标签: postgresql centos


    【解决方案1】:

    你需要安装postgresql-devel包。

    或者从源代码构建 Postgres,然后您将拥有 pg_config 而不是来自包。

    【讨论】:

      【解决方案2】:

      上面的答案是正确的:你需要安装-devel 包。此外,我通过this comment 发现,您可能需要手动指定在哪里查找pg_config 以构建psycopg2

      特别是,我跑了

      python2.7 setup.py build_ext --pg-config /usr/pgsql-9.3/bin/pg_config install
      

      请注意,此路径将取决于您的 postgres 版本。

      【讨论】:

        【解决方案3】:

        对于 AWS linux(或 RedHat)使用:

        sudo yum install postgresql-devel
        

        【讨论】:

          猜你喜欢
          • 2011-03-31
          • 1970-01-01
          • 2012-03-27
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2011-01-08
          • 2011-03-25
          相关资源
          最近更新 更多