在Heroku上开始使用Python - 找不到pg_config可执行文件 [英] Getting Started with Python on Heroku - pg_config executable not found
问题描述
我一直在关注文档,直到安装requirements.txt文件。尝试安装第6行psycopg2 == 2.5.3时总会失败。这是消息 -
下载/解包psycopg2 == 2.5.3(from -r requirements.txt(line 6))
下载psycopg2-2.5.3.tar.gz(690kB):690kB已下载
运行setup.py(路径:/ Users / pimpc / Sites / python / herokudemo / python-getting-started / venv / build / psycopg2 / setup.py)egg_info for package psycopg2
错误:未找到pg_config可执行文件。
请将包含pg_config的目录添加到PATH
中,或者使用以下选项指定完整的可执行文件路径:
python setup.py build_ext --pg-config / path / to / pg_config构建...
或使用'setup.cfg'中的pg_config选项。
完成python的输出setup.py egg_info:
正在运行egg_info
创建pip-egg-info / psycopg2.egg -info
写入pip -egg-info / psycopg2.egg-info / PKG-INFO
将顶级名称写入
pip-egg-info / psycopg2.egg-info / top_level.txt
写作dependency_links to
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 ...
或'setup.cfg'中的pg_config选项。
当然,我在此找到了几篇文章。所以我开始检查一些东西。我相信mac的postgres应用程序带有psycopg2。我有postgres添加到我的路径和终端运行echo $ PATH检查。我没有任何其他旧版本冲突。和postgres文档说我应该把它添加到我的路径中 -
$ b
export PATH =/ Applications / Postgres.app / Contents /版本/ 9.3 / bin:$ PATH:$ PATH
我已重新启动postgres应用程序,取消激活并重新启动虚拟env,无论如何,同样的错误。
我可能会忽略什么?我已阅读并阅读这里的其他帖子,甚至是关于这个问题的博客。
在阅读了许多人都用postgres mac应用程序发现的相同错误之后。我决定通过brew安装postgres,现在一切正常。
I have been following the documentation until I got to the point of installing the requirements.txt file. It always fails when trying to install line 6 "psycopg2==2.5.3". Here is the message -
Downloading/unpacking psycopg2==2.5.3 (from -r requirements.txt (line 6))
Downloading psycopg2-2.5.3.tar.gz (690kB): 690kB downloaded
Running setup.py (path:/Users/pimpc/Sites/python/herokudemo/python-getting-started/venv/build/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'.
Of course I found several posts on this. So I started checking things. I believe that postgres app for mac comes with psycopg2. I do have postgres added to my path and checked in terminal running "echo $PATH". I do not have any other old versions conflicting. And postgres documentation says I should have it added to my path like this -
export PATH="/Applications/Postgres.app/Contents/Versions/9.3/bin:$PATH:$PATH"
I have restarted postgres app, deactivated and restarted virtual env and I get the same error no matter what.
What could I possibly be overlooking! I have read and read other posts on here, and even blogs covering this issue.
After reading dozens of the same errors people were all having with the postgres mac app. I decided to install postgres via brew and now it all works just fine.
这篇关于在Heroku上开始使用Python - 找不到pg_config可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!