atom-python-run
atom-python-run copied to clipboard
importError: No module named request
import urllib.request response = urllib.request.urlopen('http://python.org/') html = response.read() print(html)
When i run importError: No module named request.But python3 console above codes is working. May I know how can i fix this error.
Only Python3 supports import urllib.request. However in Python2 you need something different: from urllib2 import urlopen. EDIT: Oh, you need to change the command in settings which executes the file. Change python {file} to python3 {file} and the same thing below at pause.
This should work. I had the same problem.