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

问题描述

我正在尝试在Mac-book上安装Psycopg2.我仍然遇到相同的错误.我在Stack Overflow上发现了很多相同的问题,但似乎没有答案.我认为这已经过时了.我正在使用:

I'm trying to install Psycopg2 on my Mac-book. I still get the same error. I found a lot of same questions on Stack Overflow but no answer seems to work. I think it is outdated. I'm using:

Mac osx 10.9.5
Python 3.4.3

我的错误代码是:

请将包含pg_config的目录添加到PATH或指定 带有以下选项的完整可执行路径:

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 ...

python setup.py build_ext --pg-config /path/to/pg_config build ...

或在'setup.cfg'中使用pg_config选项.来自的完整输出 命令python setup.py egg_info:运行egg_info

or with the pg_config option in 'setup.cfg'. Complete output from command python setup.py egg_info: running egg_info

编写pip-egg-info/psycopg2.egg-info/PKG-INFO

writing pip-egg-info/psycopg2.egg-info/PKG-INFO

将顶级名称写入 pip-egg-info/psycopg2.egg-info/top_level.txt

writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt

将dependency_links写入 pip-egg-info/psycopg2.egg-info/dependency_links.txt

writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt

警告:manifest_maker:找不到标准文件'-c'

warning: manifest_maker: standard file '-c' not found

错误:找不到pg_config可执行文件.

Error: pg_config executable not found.

请将包含pg_config的目录添加到PATH

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 ...

python setup.py build_ext --pg-config /path/to/pg_config build ...

或在'setup.cfg'中使用pg_config选项.

or with the pg_config option in 'setup.cfg'.

命令python setup.py egg_info失败,错误代码为1 /Users/stevengerrits/build/psycopg2存储完整的登录名 /Users/stevengerrits/Library/Logs/pip.log

Command python setup.py egg_info failed with error code 1 in /Users/stevengerrits/build/psycopg2 Storing complete log in /Users/stevengerrits/Library/Logs/pip.log

推荐答案

您似乎没有安装postgres,请检查如何在系统中安装postgresql,一种方法是brew install postgresql(如果您使用自制软件,建议使用)或从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 isbrew 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.

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

07-23 20:31