【问题标题】:Getting "Requested runtime is not available for this stack (heroku-20)." error with correct versions of Python [duplicate]获取“请求的运行时不适用于此堆栈(heroku-20)。”正确版本的 Python 出错
【发布时间】:2021-12-12 10:32:21
【问题描述】:

我在其他任何地方都找不到的主要问题是括号包含 runtime.txt 的所有其他行。这让我相信还有其他问题,但我在网上找不到任何解决方案。附上构建日志以供参考。

-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Python app detected
-----> Using Python version specified in runtime.txt
 !     Requested runtime (asgiref==3.4.1
colorama==0.4.4
comtypes==1.1.10
cycler==0.10.0
dj-database-url==0.5.0
Django==3.2.6
docx2pdf==0.1.7
gunicorn==20.1.0
joblib==1.0.1
kiwisolver==1.3.2
lxml==4.6.3
matplotlib==3.4.3
mysql-connector-python==8.0.26
numpy==1.21.2
Pillow==8.3.2
psycopg2==2.9.1
pyparsing==2.4.7
python-dateutil==2.8.2
python-docx==0.8.11
pytz==2021.1
pywin32==227
scikit-learn==0.24.2
scipy==1.7.1
six==1.16.0
sklearn==0.0
sqlparse==0.4.1
threadpoolctl==2.2.0
tqdm==4.62.3
whitenoise==5.3.0
python-3.9.7) is not available for this stack (heroku-20).
 !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
 !     Push rejected, failed to compile Python app.
 !     Push failed

【问题讨论】:

  • 这是Django application error when deploying to heroku 的骗子,但不幸的是我不能作为骗子关闭,因为没有答案被赞成或接受。那边的 OP 评论说 my answer 解决了他们的问题,但忽略了接受它。基本上,您的runtime.txt 应该包含仅 python-3.9.7。所有其他依赖项都进入requirements.txt。

标签: python django heroku deployment runtime


【解决方案1】:

我解决了这个问题,问题原来是pywin32==227 行。显然我在 windows 中编写了所有代码,heroku 在 linux 上,因此它没有说话,我只是删除了 pywin32 行,它现在可以工作了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-13
    • 1970-01-01
    • 2019-07-17
    • 2021-01-10
    • 2017-08-04
    • 2019-08-08
    • 2021-10-27
    相关资源
    最近更新 更多