0

I'm using python 3 but i've got python 2 on my computer also so I've been installing all my modules with pip3. I keep getting attribute errors.

Traceback (most recent call last):
  File "/home/ro/autoblg.py", line 3, in <module>
    htmlfile = urllib.urlopen("http://www.dailymail.co.uk/home/index.html")
AttributeError: 'module' object has no attribute 'urlopen'

here is my code on the last bit of code I wrote

import urllib

htmlfile = urllib.urlopen("http://www.dailymail.co.uk/home/index.html")

htmltext = htmlfile.read()

print(htmltext)

It keeps doing it with other modules I already have installed.

booberz
  • 371
  • 1
  • 3
  • 20
  • How do you know which version of python this is running under? – Scott Hunter Oct 12 '15 at 12:57
  • I've done sudo pip3 install urllib3 and it says it's already installed and I'm running it python3 because I get an error when I don't use brackets on my print statement. – booberz Oct 12 '15 at 13:00

0 Answers0