Issue 25980: not able to find module request in lib urllib - Python35-32 (original) (raw)
Issue25980
Created on 2015-12-30 10:15 by Kiran Kotari, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Messages (3) | ||
---|---|---|
msg257230 - (view) | Author: Kiran Kotari (Kiran Kotari) | Date: 2015-12-30 10:15 |
Python 3.5.1 documentation code giving following error: Error: Traceback (most recent call last): File ".\urllib1.py", line 5, in with urllib.request.urlopen('http://www.py4inf.com/code/romeo.txt') as f: AttributeError: module 'urllib' has no attribute 'request' Python Code: import urllib with urllib.request.urlopen('http://www.py4inf.com/code/romeo.txt') as f: print(f.read()) | ||
msg257232 - (view) | Author: R. David Murray (r.david.murray) * ![]() |
Date: 2015-12-30 13:56 |
Can you provide a link to the documentation you find to be in error? | ||
msg257233 - (view) | Author: Brett Cannon (brett.cannon) * ![]() |
Date: 2015-12-30 17:51 |
You need to use the line `import urllib.request` to make the import work as you didn't import the urllib.request module, only the urllib package. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:25 | admin | set | github: 70168 |
2015-12-30 17:51:26 | brett.cannon | set | status: open -> closednosy: + brett.cannonmessages: + resolution: not a bug |
2015-12-30 13:56:18 | r.david.murray | set | nosy: + r.david.murraymessages: + |
2015-12-30 10:15:37 | Kiran Kotari | create |