Python无法识别导入模块

时间:2017-06-28 11:00:12

标签: python python-3.x urllib

我正在尝试import urllib.parse模块,唉,没有成功。

我在我的MacOS上安装了Python 2.7和3.6,这应该足够了,但是,在启动时python3 url.py我收到此错误:

Traceback (most recent call last):
  File "url.py", line 1, in <module>
    import urllib.parse, urllib.request
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 88, in <module>
    import http.client
    ModuleNotFoundError: No module named 'http.client'; 'http' is not a package

url.py

import urllib.parse, urllib.request
# from bs4 import BeautifulSoup
fhand = urllib.request.urlopen("http://someurl.com")

0 个答案:

没有答案