在MacOS 10.9.5上安装Psycopg2时出错 [英] Error Installing Psycopg2 on MacOS 10.9.5

查看:51
本文介绍了在MacOS 10.9.5上安装Psycopg2时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Macbook上安装 Psycopg2 ,但出现错误.我在StackOverflow上发现了很多相同的问题,但似乎没有答案.
我正在使用:

I'm trying to install Psycopg2 on my Macbook, but I am getting an error. I found a lot of the same questions on StackOverflow but no answer seems to work.
I'm using:

OS:MacOS 10.9.5
Python版本:3.4.3

OS: MacOS 10.9.5
Python Version: 3.4.3

我的错误代码是:

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

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
/Users/sg/build/psycopg2 Storing complete log in
/Users/sg/Library/Logs/pip.log

推荐答案

您似乎没有安装postgres,请检查如何在系统中安装postgresql,一种方法是 brew install postgresql (如果使用homebrew,建议使用)或从postgresapp.com下载postgres应用程序,pg_config应该随postgres一起提供,而psycopg2试图找到它.

You don't seem to have postgres installed, check how to install postgresql in your system, one of the way is brew install postgresql (if you use homebrew- recommended) or download the postgres app from postgresapp.com, pg_config should come with postgres and psycopg2 is trying to find it.

这篇关于在MacOS 10.9.5上安装Psycopg2时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆