import etree
时间: 2023-11-08 09:06:13 浏览: 76
Python3.5以上版本lxml导入etree报错的解决方案
4星 · 用户满意度95%
在Python中,`from lxml import etree`用于导入lxml库的etree模块。 但是在您的情况下,您遇到了一些问题,lxml中没有etree模块。根据您提供的信息,您可以尝试使用`from lxml import html`来代替`from lxml import etree`。 如果您在安装lxml时遇到了问题,您可以尝试使用阿里源的地址进行安装,即`pip install -i https://mirrors.aliyun.com/pypi/simple/ lxml`。 这样您就可以成功安装lxml并使用相应的模块了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [from lxml import etree](https://download.csdn.net/download/q717095198/9976337)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [from lxml import etree报错](https://blog.csdn.net/weixin_44649870/article/details/91043989)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [xpath解析](https://blog.csdn.net/KKKKKKKMAx/article/details/125531618)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文