Python 3: AttributeError: 'module' object has no attribute '__path__' using urllib in terminal
问题 My code is runnning perfectly in PyCharm, but I have error messages while trying to open it in terminal. What's wrong with my code, or where I made mistakes? import urllib.request with urllib.request.urlopen('http://python.org/') as response: html = response.read() print(html) Output from terminal: λ python Desktop\url1.py Traceback (most recent call last): File "<frozen importlib._bootstrap>", line 2218, in _find_and_load_unlocked AttributeError: 'module' object has no attribute '__path__'