【发布时间】:2012-06-24 08:43:03
【问题描述】:
我正在尝试使用 Windows 在 Heroku 上启动 Django 应用程序,当我尝试 pip install psycopg2 时遇到以下错误:
Downloading/unpacking psycopg2
Downloading psycopg2-2.4.5.tar.gz (719Kb): 719Kb downloaded
Running 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
我用谷歌搜索了这个错误,看来你需要 libpq-dev python-dev 作为 Python 下 postgres 的依赖项。我还打开了一个链接,如果你的路径中没有 postgres bin 文件夹,你就会遇到麻烦,所以我手动安装了 Postgres 并再次尝试。这次我得到:
error: Unable to find vcvarsall.bat
我仍然是蟒蛇 N00b,所以我迷路了。有人能指出我大致的方向吗?
【问题讨论】:
-
您不能在 windows 上通过 pip 安装 psycopg2(如果您遇到了设置编译器的麻烦,也许可以?),二进制文件可在 stickpeople.com/projects/python/win-psycopg
-
真的吗?我刚刚为 Windows 手动安装了 Postgres 并解决了我的上述错误。我现在陷入下一个错误:无法找到 vcvarsall.bat
-
我很确定错误与不存在的编译器有关。
-
在 Windows 上设置包的编译是自虐的,但如果这是你的乐趣,这可能会帮助你开始:blog.victorjabur.com/2011/06/05/…
-
或使用mingw32 docs.cython.org/src/tutorial/appendix.html
标签: python django postgresql heroku