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

推荐订阅源

B
Blog
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
罗磊的独立博客
J
Java Code Geeks
人人都是产品经理
人人都是产品经理
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
Jina AI
Jina AI
F
Fortinet All Blogs
H
Help Net Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Last Week in AI
Last Week in AI
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
C
Check Point Blog
GbyAI
GbyAI

博客园 - 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)