【问题标题】:Python lxml error in Google Colab even after installing lxml with pip and pip3即使在使用 pip 和 pip3 安装 lxml 后,Google Colab 中的 Python lxml 错误
【发布时间】:2018-12-05 18:49:45
【问题描述】:
from lxml import etree 命令在 google colab 中给出以下错误:
ModuleNotFoundError:没有名为“lxml”的模块
但是,如果我尝试使用命令 !pip3 install lxml 或 !pip install lxml 安装它,它会给出以下信息:
已满足要求:/root/.local/lib/python3.6/site-packages (4.2.5) 中的 lxml
【问题讨论】:
标签:
lxml
google-colaboratory
【解决方案1】:
提到/root/.local/lib 很奇怪,让我觉得你的虚拟机被之前的尝试弄糊涂了。如果您“重置所有运行时”以获取新的 VM,以下操作对您有用吗? (对我有用)
!pip install lxml
from lxml import etree
help(etree)