import urllib2
Traceback (most recent call last):
File "", line 1, in
import urllib2
ImportError: No module named 'urllib2'
So urllib2 has been been replaced by the package : urllib.request.
Here is the PEP link (Python Enhancement Proposals )
http://www.python.org/dev/peps/pep-3108/#urllib-package
so instead of urllib2 you can now import urllib.request and then use it like this:
>>>import urllib.request
>>>urllib.request.urlopen('http://www.placementyogi.com')
Original Link : http://placementyogi.com/articles/python/importerror-no-module-named-urllib2-in-python-3-x