Home > Q&A > body text
1
from urllib.error import URLError, HTTPError
from
urllib.error
import
URLError, HTTPError
ImportError: No module named error
三叔2016-10-28 16:32:26
应该是版本问题,py2.7报错,3.5就不会.
2
3
4
5
6
7
8
9
python2.7:
python2.
:
>>> import urllib
>>>
urllib
>>> 'error' in dir(urllib)
'error'
in
dir
(urllib)
False
python3.5:
python3.
True