【发布时间】:2018-05-09 11:38:25
【问题描述】:
我想部署到 Heroku。但是会显示错误消息。
$ git push heroku master
这会生成以下错误输出:
remote: Error: could not determine PostgreSQL version from '10.3'
remote:
remote: ----------------------------------------
remote: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-7sfvmk3a/psycopg2/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to ayblog.
remote:
To https://git.heroku.com/ayblog.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ayblog.git'
我认为“错误:无法从 '10.3' 确定 PostgreSQL 版本”是错误的。
我的事情“命令“python setup.py egg_info”失败,错误代码1在/tmp/pip-build-7sfvmk3a/psycopg2/”也是错误的。
怎么做?
【问题讨论】:
-
你安装了
pip install psycopg2吗?您的requirements.txt文件中还有psycopg2库的记录吗? -
非常感谢您的回复。我在 requirements.txt 中安装了 psycopg2。我想知道如何指定 psycopg2 版本。