tox,pd.read\u html无法找到lxml,即使它位于requirements.txt中

2024-05-19 02:50:48 发布

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

我有一些使用pandas.read_html的代码,它随后需要lxml。我添加了lxml(尝试了lxml和lxml>;=4.5.0)。但是tox找不到包裹:

.tox/py3/lib/python3.7/site-packages/pandas/io/html.py:848: in _parser_dispatch
    raise ImportError("lxml not found, please install it")
E   ImportError: lxml not found, please install it 

在我的tox.ini中:

[testenv]
# install pytest in the virtualenv where commands will be executed
deps =
    -rrequirements.txt
    -rrequirements_test.txt
    coverage

在my requirements.txt中:

numpy
scipy 
requests
lxml>=4.5.0
pandas

知道为什么会这样吗?在我正常的python开发中不会出现此异常,但由于某些原因tox无法安装它。但它与其他软件包没有问题

最好的

J


Tags: install代码intxttoxpandasreadhtml

热门问题