gpt4 book ai didi

python - 在Mac OS X 10.9.5上安装Psycopg2

转载 作者:行者123 更新时间:2023-12-03 08:38:00 29 4
gpt4 key购买 nike

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

Mac osx 10.9.5
Python 3.4.3

我的错误代码是:

Running setup.py egg_info for package psycopg2 Error: pg_configexecutable not found.


Please add the directory containing pg_config to the PATH or specifythe 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 fromcommand python setup.py egg_info: running egg_info


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


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


writing dependency_links topip-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(如果您使用自制软件,建议使用)
或从postgresapp.com下载postgres应用程序,pg_config应该随postgres一起提供,而psycopg2试图找到它。

关于python - 在Mac OS X 10.9.5上安装Psycopg2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64854577/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com