Python提示错误 module 'request' has no attribute 'urlretrieve'
1、直接使用request.urlretrieve显示出这种错误,翻译为‘模块’request’没有属性’urlretrieve’’
图1、代码
request.urlretrieve(img_url,'images/' + img_name)
图2、显示结果
module 'request' has no attribute 'urlretrieve'
2、导入urllib库
图3、代码
from six.moves import urllib
3.然后在之前的代码加上‘urllib.’,即可,如下
图4、代码
urllib.request.urlretrieve(img_url,'images/' + img_name)
成功(^-^)V
Python提示错误 module 'request' has no attribute 'urlretrieve'相关推荐
- 安装第二天import tensorflow 出现如下错误module ‘tensorflow‘ has no attribute ‘compat‘
tensor flow使用conda下安装 项目场景: 问题描述: 解决方案: 解决问题: 项目场景: 在安装完成后,使用import tensorflow产生错误 module 'tensorflo ...
- python提示错误TypeError: 'dict_keys' object does not support indexing
python提示错误TypeError: 'dict_keys' object does not support indexing 原因:python2与python3之间的差异 python2中形如 ...
- python脚本AttributeError: module 'xxxx' has no attribute 'xxxxx'错误解决办法
最近写脚本发现了这样的一个错误,脚本.环境什么的完全正确,但执行的时候却报错:AttributeError: module 'xxxx' has no attribute 'xxxxx',查阅了一些相 ...
- 【Python】AttributeError: module ‘numpy’ has no attribute ‘unit8’ 的解决方法
经排查,下面的一行代码出了异常: mask2 = np.where((mask1 == 2) | (mask1 == 0), 0, 1).astype('unit8') 异常类型是: Attribut ...
- python efficientdet AttributeError: module ‘gast‘ has no attribute ‘Num‘
今天在用efficientDet跑模型的时候,出现了下面的警告: WARNING:tensorflow:Entity <bound method RegressBoxes.call of < ...
- python提示错误TypeError: write() argument must be str, not bytes
还是在学习<Machine Learning in Action>中决策树一章中,在学习决策树存储过程中先是提示错误TypeError: write() argument must be ...
- python 提示错误AttributeError: type object 'str' has no attribute '_name_'
在做<Machine Learning in Action>书中的第三章绘制树形图时遇到了这个问题AttributeError: type object 'str' has no attr ...
- Python出现AttributeError: module ‘tkinter‘ has no attribute ‘messagebox‘,已解决
Python使用对话框显示提示信息出现无messagebox属性 解决:引入tkinter.messagebox包即可 import tkinter.messagebox
- Python 提示 ModuleNotFoundError: No module named ‘common‘
Python Error Python 提示错误的解决方案ModuleNotFoundError: No module named 'common' 在cmd中执行程序,所在路径是python的搜索路 ...
最新文章
- java指定位置写入_java指定路径写、读文件
- 如何给定两个gps坐标 算出航向角_如何获得飞机的小扰动模型
- 使用 MQTTnet 快速实现 MQTT 通信
- centos 卸载软件_Linux服务器运维必备技能 软件包和启动项超详细整理
- 良好的编码风格 java_关于java:编码风格是否遵循良好做法
- jq禁用html标签
- java jxls_jxls教程
- VsVim - Shortcut Key (快捷键)
- VS找不到System.Web.Extensions.dll的解决办法
- 一个企图用代码偷懒计算测量学闭合导线各项数据的屑是否有错
- EC20模块GPGGA协议
- Glance 镜像服务
- 音乐播放器制作 (HTML + CSS + JavaScript)
- 学习笔记——共阳数码管的静态显示
- 高校GIS系统有何作用?
- 恒丰银行计算机岗位面试题,2019恒丰银行招聘面试试题及参考答案
- Java简单雷电游戏代码
- CSU1020-真三国无双-模拟
- 干货 | 机器学习模型在携程海外酒店推荐场景中的应用
- 农民工买房子 更多热点和冷笑话