Python - Metmatplotlib error
Question: I am using Windows 7. I have installed Python 3.4 and Metmatplotlib.

I have tried the below code

    
    
    from pylab import *
    plot([1,2,3])
    show()
    

But i am getting the follwoign error

    
    
    Traceback (most recent call last):
      File "E:/Work/Python/Training/Samples.py", line 1, in <module>
        from pylab import *
      File "C:\Python34\lib\site-packages\pylab.py", line 1, in <module>
        from matplotlib.pylab import *
      File "C:\Python34\lib\site-packages\matplotlib\__init__.py", line 169, in <module>
        from urllib2 import urlopen
    ImportError: No module named 'urllib2'
    

I have searched for the package urllib2 but not seems to be find it.

Can any one help me

Thanks,


Answer: The urllib2 module has been split across several modules in Python 3 named
urllib.request and urllib.error. The 2to3 tool will automatically adapt
imports when converting your sources to Python 3.

<https://docs.python.org/2/library/urllib2.html>

