2012-03-07 10 views
6

अजगर संस्करण CentOS 5.5 में pg_config स्थापित 2.4बिना यम

# 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 
[[email protected] 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 को स्थापित करने में असमर्थ हूं 0

उत्तर

14

आपको postgresql-devel पैकेज स्थापित करने की आवश्यकता है।

या स्रोत से पोस्टग्रेस बनाएं और फिर आपके पास pg_config पैकेज से नहीं होगा।

1

उपरोक्त उत्तर सही है: आपको -devel पैकेज स्थापित करने की आवश्यकता है। इसके अलावा, मुझे this comment के माध्यम से मिला है कि आपको psycopg2 बनाने के लिए pg_config के लिए मैन्युअल रूप से निर्दिष्ट करने की आवश्यकता हो सकती है।

विशेष रूप से, मैं चल

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

ध्यान दें कि यह मार्ग अपने postgres संस्करण पर निर्भर करेगा समापन।

2

एडब्ल्यूएस linux (या उस बात के लिए RedHat) के लिए उपयोग करें:

sudo yum install postgresql-devel 
संबंधित मुद्दे