模块未找到错误:没有名为'requests_html'的模块。

7
我正在尝试在Mac OS 10.14中使用requests-html模块,但在尝试使用pip和easy_install安装时都出现了错误,显示已经有该模块。我在Windows上进行了测试,并且命令运行正确,在CMD中直接使用pip安装。 请问是否可以帮助我?
Pip安装 使用pip安装 Easy_install安装 使用easy_install安装 Windows 10安装 在Windows 10上安装

1
你想在Python 3.X解释器中导入模块吗? - Andersson
1
我在这里看到request-html需要Python >=3.6.0,但是在你的macOS X镜像中,我看到它安装在.../Python/2.7目录下。 - scipsycho
1
是的,我安装了最新版本的Python 3.7.1,但仍然无法工作,而pip版本为18.0。 - Philll
1
尝试使用pip3而不是pip。这将使用pip的Python 3版本进行安装。 - Andrew McDowell
2
只需执行 pip3 install requests-html。请注意,pip 会为 Python 2.X 安装库,而 pip3 则是为 Python 3.X 安装。针对特定解释器版本安装的库无法被另一个版本访问。 - Andersson
显示剩余3条评论
2个回答

14
  1. 确保您拥有Python 3.6或更高版本。
  2. 执行pip3 install requests-html

感谢 Andersson 的答案。我目前不能留言,所以在这里写了回复。


0

尝试在Windows上使用requests html,但没有成功,以下是情况的图片: 通过pip3安装满足requests html依赖项

trying to run requests according to the manual pages


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接