Установите libpq-dev в Mac OS X

Я пытаюсь запустить Django с бэкэндом Postgresql на своей локальной Mac OS X. Я установил Django с помощью pip:

sudo pip install Django

Я установил Postgresql с помощью одного из бинарных установщиков здесь .

Но когда я пытаюсь установить psycopg2, я получаю сообщение об ошибке (вставленное ниже), что он не может найти pg_config.

Судя по этому вопросу, мне следует установить libpq-dev, но я не знаю, как это сделать.

Я пытался установить libpqxxс MacPorts, но это ничего не дало.

Как установить libpg-dev? Или есть что-то еще, что мне не хватает?

henrietta:~ $ pip install psycopg2
Downloading/unpacking psycopg2
  Downloading psycopg2-2.4.5.tar.gz (719Kb): 719Kb downloaded
  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
Storing complete log in /Users/thomas/.pip/pip.log

13
задан Community 23 May 2017 в 12:34
поделиться