惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
爱范儿
爱范儿
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
IT之家
IT之家
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
Microsoft Azure Blog
Microsoft Azure Blog
The GitHub Blog
The GitHub Blog
C
Check Point Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - Franky
G
Google Developers Blog
V
V2EX
雷峰网
雷峰网
美团技术团队
博客园 - 【当耐特】
人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
V
Visual Studio Blog
J
Java Code Geeks

博客园 - DavidZang

17款code review工具 IIS ip访问限制插件 iis 限制动态IP地址访问次数 亚马逊AWS云搭建安全、简单(10分钟)、免费(一年)的VPN服务 - DavidZang AWS云使用100条宝贵经验分享 C# 开源框架(整理) 如何获取Azure AD tenant的tenant Id? 基于Deep Learning 的视频识别方法概览 Deep learning深度学习的十大开源框架 windows下,下载pip安装 Apache与Tomcat有什么关系和区别 创建包含多个子网的虚拟网络 适用于 Azure 虚拟网络的常见 PowerShell 命令 手动将经典 VM 从 VHD 迁移到新的 ARM 托管磁盘 VM 将 Windows 虚拟机从非托管磁盘转换为托管磁盘 将 Azure VM 迁移到 Azure 中的托管磁盘 在 Azure Resource Manager 模板中使用托管磁盘 将 Azure 文件共享用于 Windows VM Azure 标准与高级托管磁盘存储的相互转换
python 3.3.2报错:No module named 'urllib2'
DavidZang · 2018-01-11 · via 博客园 - DavidZang

ModuleNotFoundError: No module named 'urllib3'

1. ImportError: No module named 'cookielib'1

Python3中,改成 import  http.cookiejar,然后方法里也改成 http.cookiejar,查找替换就行

2. NameError: name 'raw_input' is not defined
在版本3中已经用input()替换

3. Import error: No module name urllib
from urllib.request import urlopen


4. ImportError: No module named urllib2
Python 3中urllib2用urllib.request替代

在Python官方文档里面已有说明:

Note
The urllib2 module has been split across several modules in Python 3.0 named urllib.request and urllib.error. The 2to3 tool will automatically adapt imports when converting your sources to 3.0.

from urllib.request import urlopen
response = urlopen("http://www.google.com")
html = response.read()
print(html)

sample:

import urllib.request
resp=urllib.request.urlopen('http://www.baidu.com')
html=resp.read()
print(html)