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

查看:21
本文介绍了在 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:

操作系统: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天全站免登陆