Heroku - ImportError:无法导入名称'InsecureRequestWarning'

时间:2018-03-16 05:19:26

标签: python heroku pipenv

Heroku突然拒绝部署我的Python应用程序并出现错误:

cmd

在对Heroku上已经正常运行的内容进行完全无功能的更改时会发生这种情况。

remote:        ImportError: cannot import name 'InsecureRequestWarning'
remote:  !     Push rejected, failed to compile Python app.

看起来像Heroku的Python buildpack,特别是pipenv,已经坏了。有什么想法吗?

Python版本(runtime.txt): 3.6.4

2 个答案:

答案 0 :(得分:1)

Pipenv and Heroku's buildpack存在错误,此后已经纠正。

如果将来遇到类似问题,您可以分叉Heroku's buildpack并更改固定的Pipenv版本,或进行任何其他必要的更改。

推叉,然后设置应用程序以使用forked buildpack,例如

heroku buildpacks:set https://github.com/Benjamin-Dobell/heroku-buildpack-python.git\#7e0da719744f0f5185a624d38877effa142d6639
Salesforce / Heroku的Kenneth Reitz还建议使用以下命令清除任何与Pipenv / buildpack相关的问题:

heroku plugins:install heroku-repo
heroku repo:purge_cache

答案 1 :(得分:0)

请不要将 python -version 添加到此工作流程并告诉我们这是什么?我怀疑它是Python< 2.7.9。

请参阅Suppress InsecureRequestWarning: Unverified HTTPS request is being made in Python2.6