Import Doesn't Import

ryguy7272 ryanshuell at gmail.com
Thu Oct 16 02:44:00 CEST 2014


On Wednesday, October 15, 2014 8:40:40 PM UTC-4, ryguy7272 wrote:
> 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!!!!!


Either this is the most brilliant thing ever invented, or it's the biggest piece of shit ever invented.  I just can't tell.  All I know for sure, is that it doesn't do ANYTHING that I tell it to do.  

If there is another way of running Python code, like using Visual Studio, or a text file, or some such thing, let me know, and I'll do it.  It seems like you should use Python to run Python, but my Python doesn't do anything at all.  Yesterday I uninstalled Python 2.7, because that wouldn't do anything either.  I'm just about ready to uninstall 3.4.




More information about the Python-list mailing list