我在我的脚本中导入 urllib : import urllib2 as urllib
但是当我将我的应用程序推送到 heroku 时,我遇到了这个错误:
remote: -----> Installing requirements with pip
remote: Collecting urllib (from -r /tmp/build_1d35698f2d5b9e170c92042828569c91/requirements.txt (line 3))
remote: Could not find a version that satisfies the requirement urllib (from -r /tmp/build_1d35698f2d5b9e170c92042828569c91/requirements.txt (line 3)) (from versions: )
remote: No matching distribution found for urllib (from -r /tmp/build_1d35698f2d5b9e170c92042828569c91/requirements.txt (line 3))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
我能做什么 ?提前致谢!
urllib2
被内置的包在Python 2(重命名为urllib.request
和urllib.error
在Python 3)。因此它不需要安装,也不应该在你的 requirements.txt 中。
从 requirements.txt 文件中删除urllib
或urllib2
(提示:从你的错误中给出,urllib
从 requirements.txt 的第三行中删除)那么你的错误应该消失了。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句