将htmldate与Python结合使用时出现的问题

2024-10-02 00:42:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在Anaconda中使用Python开发一个小脚本,以使用htmldate,当我尝试运行它时,出现了一些错误:

代码如下:

import htmldate as hd
hd.find_date('http://blog.python.org/2016/12/python-360-is-now-available.html')

错误是ImportError: cannot import name etree。如果我安装了lxml,我已经检查了pip列表,我可以看到我已经安装了版本4.5.2,那么会发生什么呢?。非常感谢。我有Python 3.6


Tags: 代码orgimport脚本httpdateisas
2条回答

由于某些原因,python无法找到lml

要解决此问题,请尝试卸载,然后安装lxml:

python -m pip uninstall lxml
python -m pip install lxml

重新安装后,我从Anaconda中清理了缓存,它工作得非常好

相关问题 更多 >

    热门问题