Python 3.2 Unable to import urllib2 (ImportError: No module named urllib2)
python, python-3.x, urllib2, windows
Solution
In python 3 urllib2 was merged into urllib. See also another Stack Overflow question and the urllib PEP 3108.
To make Python 2 code work in Python 3:
try:
import urllib.request as urllib2
except ImportError:
import urllib2
Problem
I am using Windows, and I get the error: ``` ImportError: No module named urllib2 ``` I think this is the solution for Linux. But how to set this in Windows? I am using Python 3.2 and I am not able see `urllib2` there in the LiB folder.