gpt4 book ai didi

python - 无法导入名称 ‘etree’

转载 作者:太空宇宙 更新时间:2023-11-04 02:20:50 24 4
gpt4 key购买 nike

尝试从 serpscrap 包运行示例 .py 时出现错误。

我在 Pythonista 中使用 iPhoneX。

如有任何帮助,我们将不胜感激。

这是回溯

Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/C27C5B11-1804-47B9-AF18-7287A8337C55/Pythonista3/Documents/testing/serpscrapetest.py", line 3, in <module>
import serpscrap
File "/private/var/mobile/Containers/Shared/AppGroup/C27C5B11-1804-47B9-AF18-7287A8337C55/Pythonista3/Documents/site-packages-3/serpscrap/__init__.py", line 5, in <module>
from serpscrap.serpscrap import SerpScrap
File "/private/var/mobile/Containers/Shared/AppGroup/C27C5B11-1804-47B9-AF18-7287A8337C55/Pythonista3/Documents/site-packages-3/serpscrap/serpscrap.py", line 11, in <module>
from scrapcore.core import Core
File "/private/var/mobile/Containers/Shared/AppGroup/C27C5B11-1804-47B9-AF18-7287A8337C55/Pythonista3/Documents/site-packages-3/scrapcore/core.py", line 8, in <module>
from scrapcore.cachemanager import CacheManager
File "/private/var/mobile/Containers/Shared/AppGroup/C27C5B11-1804-47B9-AF18-7287A8337C55/Pythonista3/Documents/site-packages-3/scrapcore/cachemanager.py", line 11, in <module>
from scrapcore.parsing import Parsing
File "/private/var/mobile/Containers/Shared/AppGroup/C27C5B11-1804-47B9-AF18-7287A8337C55/Pythonista3/Documents/site-packages-3/scrapcore/parsing.py", line 6, in <module>
from scrapcore.parser.google_parser import GoogleParser
File "/private/var/mobile/Containers/Shared/AppGroup/C27C5B11-1804-47B9-AF18-7287A8337C55/Pythonista3/Documents/site-packages-3/scrapcore/parser/google_parser.py", line 7, in <module>
from scrapcore.parser.parser import Parser
File "/private/var/mobile/Containers/Shared/AppGroup/C27C5B11-1804-47B9-AF18-7287A8337C55/Pythonista3/Documents/site-packages-3/scrapcore/parser/parser.py", line 7, in <module>
import lxml.html
File "/private/var/mobile/Containers/Shared/AppGroup/C27C5B11-1804-47B9-AF18-7287A8337C55/Pythonista3/Documents/site-packages-3/lxml/html/__init__.py", line 54, in <module>
from .. import etree
ImportError: cannot import name 'etree'

最佳答案

SerpScrap 目前不能在 iOS 上运行,因为 lxml 依赖。我将更新文档以澄清这一点。

但也许你可以看看 https://github.com/pybee/Python-Apple-support .我不熟悉 iOS,也许有人可以检查这是否有助于解决此问题。否则请随时在 serpscrap github 页面上提出问题。

关于python - 无法导入名称 ‘etree’,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51679512/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com