psycopg2 のインストールで問題が発生しています。 インストールしようとすると、次のエラーが表示されますpip install 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'.
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/psycopg2
しかし、問題はpg_config
実際には私の にありますPATH
。問題なく動作します。
$ which pg_config
/usr/pgsql-9.1/bin/pg_config
私はファイルにpg_configパスを追加しsetup.cfg
、ウェブサイトからダウンロードしたソースファイルを使用してビルドしてみました(http://initd.org/psycopg/) と入力すると、次のエラー メッセージが表示されます。
Error: Unable to find 'pg_config' file in '/usr/pgsql-9.1/bin/'
しかし、それは実際にそこにあります!!!
これらのエラーに困惑しています。どなたか助けていただけませんか?
ちなみに、私はsudo
すべてのコマンドを実行しました。また、私は RHEL 5.5 を使用しています。
ベストアンサー1
pg_config
postgresql-devel
( libpq-dev
Debian/Ubuntu、 Centos/Fedora/Cygwin/Babun にありますlibpq-devel
。)