python3 报错: AttributeError: 'module' object has no attribute 'urlopen'
来源:互联网 发布:xls导入sqlserver 编辑:程序博客网 时间:2024/04/29 05:07
python3 中import urllib之后应用的时候会报错:
httpcode=urllib.urlopen(‘www.baidu.com’)
错误: AttributeError: 'module' object has no attribute 'urlopen'
经过查询python文档得知,在python3中urllib方法变化了一些:
https://docs.python.org/3/library/urllib.request.html#urllib.request.urlopen
更改成:import urllib.request
httpcode = urllib.request.urlopen(m)
则可以运行成功。
0 0
- python3 报错: AttributeError: 'module' object has no attribute 'urlopen'
- AttributeError: 'module' object has no attribute 'urlopen'
- Python3.X识别混合编码,顺便解决“AttributeError: 'module' object has no attribute 'urlopen'”
- Python 2.7.3 AttributeError: 'module' object has no attribute 'urlopen'
- import module报错AttributeError: 'module' object has no attribute
- 报错AttributeError: 'module' object has no attribute 'HTTPSConnection'
- 报错 AttributeError: 'module' object has no attribute 'bool_'
- Tensorflow报错:AttributeError: 'module' object has no attribute 'summary'
- 【Tensorflow】报错:AttributeError: 'module' object has no attribute 'scalar_summary'
- Tensorflow报错:AttributeError: 'module' object has no attribute 'scalar_summary'
- pandas报错AttributeError: 'module' object has no attribute 'plotting'
- tensorflow报错:AttributeError: 'module' object has no attribute 'get_or_create_global_step'
- AttributeError: module 'urllib' has no attribute 'urlopen'
- Python3.x中出现 "AttributeError: module 'urllib' has no attribute 'urlopen'" 的解决方法
- AttributeError: 'module' object has no attribute 'getpass'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'module' object has no attribute(转)
- AttributeError: 'module' object has no attribute 'randint'
-  和 的区别
- 警察与厨师
- 自定义控件三部曲之绘图篇(十五)——QQ红点拖动删除效果实现(基本原理篇)
- 为该类增默认构造函数、带两个参数分别对应两个数据成员初值的构造函数,以及复制构造函数
- 机器学习中的过拟合问题
- python3 报错: AttributeError: 'module' object has no attribute 'urlopen'
- VS+QT+OSG开发环境搭建及测试
- 教师兼干部类
- python 3.5网页下载器
- Qt5 与JavaScript互调
- PHP Apache 配置
- win10系统中安装oracle10g过程中遇到“未在当前操作系统中经过认证 ”的解决办法
- 在数组类的基础上,将之改造为类模板,以使数组中可以存储各种类型的数据
- [Android] NullPointerException on getActivity().runOnUiThread