Heroku - ImportError: cannot import name 'InsecureRequestWarning'
Heroku - ImportError: cannot import name 'InsecureRequestWarning'
Heroku 突然拒绝部署我的 Python 应用程序并出现错误:
remote: ImportError: cannot import name 'InsecureRequestWarning'
remote: ! Push rejected, failed to compile Python app.
当对 Heroku 上已经 运行 正常的内容部署完全非功能性更改时,就会发生这种情况。
✗ git checkout -b testing heroku/master
Branch testing set up to track remote branch master from heroku.
Switched to a new branch 'testing'
➜ fwdform2 git:(testing) ✗ echo "Garbage" > README.md
➜ fwdform2 git:(testing) ✗ git add README.md
➜ fwdform2 git:(testing) ✗ git commit -m "Non-functional changes"
[testing 7dd95cb] Non-functional changes
1 file changed, 1 insertion(+), 275 deletions(-)
rewrite README.md (100%)
➜ fwdform2 git:(testing) ✗ git push heroku testing:master
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 288 bytes | 288.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing dependencies with latest Pipenv…
remote: Traceback (most recent call last):
remote: File "/app/.heroku/python/bin/pipenv", line 11, in <module>
remote: sys.exit(cli())
remote: File "/tmp/build_ffaa2c482e67c8c4daeb9b3348ef030d/.heroku/python/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
remote: return self.main(*args, **kwargs)
remote: File "/tmp/build_ffaa2c482e67c8c4daeb9b3348ef030d/.heroku/python/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
remote: rv = self.invoke(ctx)
remote: File "/tmp/build_ffaa2c482e67c8c4daeb9b3348ef030d/.heroku/python/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1063, in invoke
remote: Command.invoke(self, ctx)
remote: File "/tmp/build_ffaa2c482e67c8c4daeb9b3348ef030d/.heroku/python/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
remote: return ctx.invoke(self.callback, **ctx.params)
remote: File "/tmp/build_ffaa2c482e67c8c4daeb9b3348ef030d/.heroku/python/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
remote: return callback(*args, **kwargs)
remote: File "/tmp/build_ffaa2c482e67c8c4daeb9b3348ef030d/.heroku/python/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
remote: return f(get_current_context(), *args, **kwargs)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pipenv/cli.py", line 62, in cli
remote: from . import core
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pipenv/core.py", line 30, in <module>
remote: from requests.packages.urllib3.exceptions import InsecureRequestWarning
remote: ImportError: cannot import name 'InsecureRequestWarning'
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to fwdform2.
remote:
To https://git.heroku.com/fwdform2.git
! [remote rejected] testing -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/fwdform2.git'
Heroku 的 Python buildpack,特别是 pipenv,似乎已损坏。有什么想法吗?
Python 版本 (runtime.txt):
3.6.4
能否将 python —version 添加到此工作流中并告诉我们那是什么?我怀疑它是 Python < 2.7.9.
见
Pipenv and Heroku's buildpack 存在错误,此错误已得到纠正。
如果以后有人遇到类似问题,您可以分叉 Heroku's buildpack 并更改固定的 Pipenv 版本,或进行任何其他必要的更改。
推动你的叉子,然后设置你的应用程序以使用你的叉子构建包,例如
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
Heroku 突然拒绝部署我的 Python 应用程序并出现错误:
remote: ImportError: cannot import name 'InsecureRequestWarning'
remote: ! Push rejected, failed to compile Python app.
当对 Heroku 上已经 运行 正常的内容部署完全非功能性更改时,就会发生这种情况。
✗ git checkout -b testing heroku/master
Branch testing set up to track remote branch master from heroku.
Switched to a new branch 'testing'
➜ fwdform2 git:(testing) ✗ echo "Garbage" > README.md
➜ fwdform2 git:(testing) ✗ git add README.md
➜ fwdform2 git:(testing) ✗ git commit -m "Non-functional changes"
[testing 7dd95cb] Non-functional changes
1 file changed, 1 insertion(+), 275 deletions(-)
rewrite README.md (100%)
➜ fwdform2 git:(testing) ✗ git push heroku testing:master
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 288 bytes | 288.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing dependencies with latest Pipenv…
remote: Traceback (most recent call last):
remote: File "/app/.heroku/python/bin/pipenv", line 11, in <module>
remote: sys.exit(cli())
remote: File "/tmp/build_ffaa2c482e67c8c4daeb9b3348ef030d/.heroku/python/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
remote: return self.main(*args, **kwargs)
remote: File "/tmp/build_ffaa2c482e67c8c4daeb9b3348ef030d/.heroku/python/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
remote: rv = self.invoke(ctx)
remote: File "/tmp/build_ffaa2c482e67c8c4daeb9b3348ef030d/.heroku/python/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1063, in invoke
remote: Command.invoke(self, ctx)
remote: File "/tmp/build_ffaa2c482e67c8c4daeb9b3348ef030d/.heroku/python/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
remote: return ctx.invoke(self.callback, **ctx.params)
remote: File "/tmp/build_ffaa2c482e67c8c4daeb9b3348ef030d/.heroku/python/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
remote: return callback(*args, **kwargs)
remote: File "/tmp/build_ffaa2c482e67c8c4daeb9b3348ef030d/.heroku/python/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
remote: return f(get_current_context(), *args, **kwargs)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pipenv/cli.py", line 62, in cli
remote: from . import core
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pipenv/core.py", line 30, in <module>
remote: from requests.packages.urllib3.exceptions import InsecureRequestWarning
remote: ImportError: cannot import name 'InsecureRequestWarning'
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to fwdform2.
remote:
To https://git.heroku.com/fwdform2.git
! [remote rejected] testing -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/fwdform2.git'
Heroku 的 Python buildpack,特别是 pipenv,似乎已损坏。有什么想法吗?
Python 版本 (runtime.txt): 3.6.4
能否将 python —version 添加到此工作流中并告诉我们那是什么?我怀疑它是 Python < 2.7.9.
见
Pipenv and Heroku's buildpack 存在错误,此错误已得到纠正。
如果以后有人遇到类似问题,您可以分叉 Heroku's buildpack 并更改固定的 Pipenv 版本,或进行任何其他必要的更改。
推动你的叉子,然后设置你的应用程序以使用你的叉子构建包,例如
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