我正在尝试使用 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,所以我迷路了。有人可以指出我的大致方向吗?