1

我们有一个本地 pypiserver,到目前为止我们对它很满意。

但是 psycopg2 制造了麻烦。它希望安装 pg_config。我看不出它应该安装在镜像服务器上的原因。我知道它需要在我安装 psycopg2 的客户端上。

这是 psycopg2 中的错误吗?或者我是否使用了错误的选项来获取镜像?

pypi@gray:~> pip install --no-deps --no-install -d packages psycopg2
Downloading/unpacking psycopg2
  File was already downloaded packages/psycopg2-2.5.1.tar.gz
  Running setup.py egg_info for package psycopg2
    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

creating pip-egg-info/psycopg2.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

writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.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 /home/pypi/tmp/pip-build/psycopg2
Storing complete log in /home/pypi/.config/pip/pip.log

我们使用这个 pypiserver:https ://pypi.python.org/pypi/pypiserver

4

1 回答 1

0

我知道这个问题已经有一年多了,但答案是 pg_config 是一个仅限 linux 的模块。您需要安装 postgresql-devel 才能获得它。

于 2014-09-24T21:48:45.133 回答