Heroku"未能编译"使用heroku / python构建包,没有pip运行的迹象

时间:2016-07-12 18:37:23

标签: python heroku deployment

我正在使用aiohttpredis开发一个Python应用程序,以便在Heroku中运行。它通过GitHub部署到Heroku。虽然在本地运行应用程序没有问题,但它无法在Heroku中构建,但出现以下错误。

-----> Using set buildpack heroku/python
-----> Python app detected
-----> Installing python-3.5.2
 !     Requested runtime (python-3.5.2
 !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
 !     Push rejected, failed to compile Python app

由于构建在pip甚至有机会运行之前中止,我不太确定出了什么问题。 runtime.txt是从单独的Heroku应用程序中复制出来的,该应用程序构建正常,我在requirements.txt中找不到任何问题。

我的requirements.txt是:

aiohttp==0.21.6
redis==2.10.5

我的runtime.txt是:

python-3.5.2

1 个答案:

答案 0 :(得分:2)

确定。所以我遇到了和你一样的问题。如果仔细观察,请看:

Requested runtime (python-3.5.2

注意"("。可能与文件的编码有关。在Ubuntu中,我使用dos2unix(apt-get install dos2unix&& dos2unix runtime.txt)解决了这个问题。或者,您可以在您喜欢的文本编辑器/ IDE中调整设置。至少您知道在哪里看。