Python 在 Windows 7 x64 上使用 pgxnclient 时找不到 pg_config 可执行文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26717436/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
pg_config executable not found when using pgxnclient on Windows 7 x64
提问by Mladen Uzelac
I installed Python 2.7.8 and pgxn client. And I tried to run this statement from command line from the bin folder and path is setup correctly
我安装了 Python 2.7.8 和 pgxn 客户端。我尝试从 bin 文件夹中的命令行运行此语句,并且路径设置正确
pgxnclient install http://api.pgxn.org/dist/pg_repack/1.2.1/pg_repack-1.2.1.zip
But I got an error pg_config executable not found.
但我有一个错误pg_config executable not found。
回答by Rahul
Bakground: pg_config is the configuration utility provided by PostgreSQL. This utility is used by various applications.
背景: pg_config 是PostgreSQL提供的配置实用程序。此实用程序由各种应用程序使用。
Solution:
解决方案:
- Install PostgreSQL.
Set the path. System Properties > Advanced
PATH:C:\Program Files (x86)\PostgreSQL\9.4\bin\;
- 安装PostgreSQL。
设置路径。系统属性 > 高级
路径:C:\Program Files (x86)\PostgreSQL\9.4\bin\;
From this point on, any application that requires pg_config can find it here.
从现在开始,任何需要 pg_config 的应用程序都可以在这里找到它。
I suggest this method because the build is directly from the author. You can also find viable alternatives for standalone pg_config builds.
我建议使用这种方法,因为构建直接来自作者。您还可以为独立的 pg_config 构建找到可行的替代方案。
回答by Neil McGuigan
I had this same error, and pg_configwas in my path
我有同样的错误,并且pg_config在我的道路上
You can try
你可以试试
pgxnclient install --pg_config "c:\path\to\pg_config.exe" $extensionName
pgxnclient install --pg_config "c:\path\to\pg_config.exe" $extensionName
You almost definitely need to run cmd.exeas an admin
您几乎肯定需要以cmd.exe管理员身份运行

