Search Placementyogi.com
 

ImportError: No module named 'urllib2' in Python 3.x

 

>>> import urllib2

Traceback (most recent call last):

  File "<pyshell#84>", line 1, in <module>

    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')

<http.client.HTTPResponse object at 0x00000000030482E8>

Nitin 2/13/2014 2:05:31 PM

its nice

Preview

Thanks for posting your comment! It will be visible soon!
Post Another Comment

6
+
8
=

Name:
Email :
Banner to LogicGuns.com

Hide Page Information