Import Doesn't Import

ryguy7272 ryanshuell at gmail.com
Wed Oct 15 20:40:25 EDT 2014


So sorry everyone.  I've posted here several times today.  This is VERY frustrating.

So, I'm reading this link.
https://docs.python.org/2/howto/urllib2.html


Fetching URLs
The simplest way to use urllib2 is as follows:
import urllib2
response = urllib2.urlopen('http://python.org/')
html = response.read()


So, I fire up Python, and create a new file and name it and hit F5.

All I have is thins in the file:
import urllib2
response = urllib2.urlopen('http://python.org/')
html = response.read()

It immediately produces this error:
Traceback (most recent call last):
  File "C:/Python34/import_web_data.py", line 1, in <module>
    import urllib2
ImportError: No module named 'urllib2'


ImportError: No module named 'urllib2'
I'm telling Python to import because it doesn't exist and it throws an error.  I don't get it; I just don't get it.  If I'm working with R, I can import thousands of libraries with no errors whatsoever.  With Python, I just get thousands of errors with nothing working whatsoever.  I totally don't understand this language.  Import means import.  Right.  WTF!!!!!




More information about the Python-list mailing list