Python heroku上的urllib错误
我在脚本中导入urllib时使用:Python heroku上的urllib错误,python,heroku,urllib,Python,Heroku,Urllib,我在脚本中导入urllib时使用:import urllib2 as urllib 但当我将我的应用程序推送到heroku时,我出现了以下错误: remote: -----> Installing requirements with pip remote: Collecting urllib (from -r /tmp/build_1d35698f2d5b9e170c92042828569c91/requirements.txt (line 3)) re
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中的内置包(在Python 3中重命名为urllib.request
和urllib.error
)。因此,它不需要安装,也不应该在requirements.txt中
从requirements.txt文件中删除
urllib
或urllib2
(提示:从错误中给出,从requirements.txt的第三行删除urllib
),则错误应该消失。urllib2
是Python 2中的内置包(在Python 3中重命名为urllib.request
和urllib.error
),因此不需要安装,也不应该在requirements.txt中
从requirements.txt文件中删除urllib
或urllib2
(提示:从错误中给出,从requirements.txt的第三行删除urllib
),然后错误应该消失