其实我是要用Document但是却提示我
from lxml import etree
ImportError: DLL load failed while importing etree: 找不到指定的程序
这个时候,先卸载,
PS C:\Users\ASUS\Desktop\MLCode> pip uninstall lxml
Found existing installation: lxml 4.6.1
Uninstalling lxml-4.6.1:
Would remove:
c:\software\anaconda\lib\site-packages\lxml-4.6.1.dist-info\*
c:\software\anaconda\lib\site-packages\lxml\*
Proceed (y/n)? y
Successfully uninstalled lxml-4.6.1
卸载完成后,在安装,用中科大镜像安装
PS C:\Users\ASUS\Desktop\MLCode> pip install lxml -i https://mirrors.bfsu.edu.cn/pypi/web/simple/
Looking in indexes: https://mirrors.bfsu.edu.cn/pypi/web/simple/
Collecting lxml
Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/e7/bc/9e7f38333767146191afbb17simple/6ffd2c1d553589a11b7e499f12aacc6cf5cd/lxml-4.6.3-cp38-cp38-win_amd64.whl (3.5 MB)
|████████████████████████████████| 3.5 MB 3.3 MB/s
Installing collected packages: lxml 6ffd2c1d553589a11b7e499f12aacc6cf5cd/lxml-4.6.3-cp38-cp38-win_amd64.whl (3.5 MB)
Successfully installed lxml-4.6.3
这样就成功了
希望能有所帮助
pyquery 库会用到lxml,建议pip install lxml, pip install pyquery都执行一边,安装一下
https://zhuanlan.zhihu.com/p/393764169