如何找到pg

编程入门 行业动态 更新时间:2024-10-23 03:13:38
本文介绍了如何找到pg_config路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 在这里完成新手,尝试设置Django来处理ProstgreSQL。

我使用的是mac osx 10.6.8。我还安装了PostgreSQL 9.3

当我在终端运行 pip install psycopg2 时,会收到以下错误

下载/打包psycopg2 下载psycopg2-2.5.2.tar.gz(685kB):685kB下载运行pack.py(path:/ private / var / folders / A9 / A99cs6x0FNusPejCVkYNTE +++ TI / -Tmp- / pip_build_bengorman / psycopg2 / setup.py)egg_info for package psycopg2 错误:pg_config可执行文件找到。 请将包含pg_config的目录添加到PATH 中,或者使用以下选项指定完整的可执行路径: python setup.py build_ext --pg-config / path / to / pg_config build ... 或与setup.cfg中的pg_config选项。 从命令完成输出python setup.py egg_info:运行egg_info 创建pip-egg-info / psycopg2.egg-info 写入点-egg-info / psycopg2.egg-info / PKG-INFO 将顶级名称写入pip-egg-info / psycopg2.egg-info / top_level.txt 将dependency_links写入pip-egg-info / psycopg2.egg-info / dependency_links.txt 写清单文件'pip-egg-info / psycopg2.egg-info / SOURCES.txt' 警告:manifest_maker:找不到标准文件'-c' 错误:找不到pg_config可执行文件。 请将包含pg_config的目录添加到PATH 中,或者使用选项指定完整的可执行路径: python setup.py build_ext --pg-config / path / to / pg_config build ... 或与pg_config选项在'setup.cfg'中。

我已经看到了这么多的帖子 how-to-install-psycopg2-with-pip-on-python ​​ pg-config-executable-not-found

但我不知道如何找到包含pg_config的bin文件夹位置。找到这条路径的任何提示?

解决方案

我建议您尝试使用Postgres.app。 ( postgresapp )这样,您可以轻松地在Mac上打开和关闭Postgres。 一旦你这样做,添加Postgres的路径到您的 .profile 文件中,通过追加以下内容:

PATH =/ Applications / Postgres.app / Contents / Versions / latest / bin:$ PATH

只有将Postgres添加到您的路径后,您可以尝试在虚拟环境(使用pip)或您的全局中安装 psycopg2 网站包。

Complete newbie here, trying to set up Django to work with ProstgreSQL.

I'm using mac osx 10.6.8. I have also installed PostgreSQL 9.3

When I run pip install psycopg2 in terminal I get the following error

Downloading/unpacking psycopg2 Downloading psycopg2-2.5.2.tar.gz (685kB): 685kB downloaded Running setup.py (path:/private/var/folders/A9/A99cs6x0FNusPejCVkYNTE+++TI/-Tmp-/pip_build_bengorman/psycopg2/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'.

I've seen a number of posts on this how-to-install-psycopg2-with-pip-on-python pg-config-executable-not-found

but I have no clue how to find the bin folder location containing pg_config. Any tips on finding this path?

解决方案

I recommend that you try to use Postgres.app. (postgresapp) This way you can easily turn Postgres on and off on your Mac. Once you do, add the path to Postgres to your .profile file by appending the following:

PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"

Only after you added Postgres to your path you can try to install psycopg2 either within a virtual environment (using pip) or into your global site packages.

更多推荐

如何找到pg

本文发布于:2023-10-16 12:05:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1497505.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:pg

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!