Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import name 'etree' from 'lxml' #611

Open
Ehcochwy opened this issue Nov 19, 2024 · 2 comments
Open

cannot import name 'etree' from 'lxml' #611

Ehcochwy opened this issue Nov 19, 2024 · 2 comments
Labels

Comments

@Ehcochwy
Copy link

感谢您申报bug,为了表示感谢,如果bug确实存在,您将出现在本项目的贡献者列表里;如果您不但发现了bug,还提供了很好的解决方案,我们会邀请您以pull request的方式成为本项目的代码贡献者(Contributor);如果您多次提供很好的pull request,我们将邀请您成为本项目的协助者(Collaborator)。当然,是否提供解决方按都是自愿的。不管是否是真正的bug、是否提供解决方案,我们都感谢您对本项目的帮助。

  • 问:请您指明哪个版本出了bug(github版/PyPi版/全部)?

答:全部

  • 问:您使用的是否是最新的程序(是/否)?

答:是

  • 问:爬取任意用户都会复现此bug吗(是/否)?

答:还没能使用程序

  • 问:若只有爬特定微博时才出bug,能否提供出错微博的weibo_id或url(非必填)?

答:

  • 问:若您已提供出错微博的weibo_id或url,可忽略此内容,否则能否提供出错账号的user_id及您配置的since_date,方便我们定位出错微博(非必填)?

答:

  • 问:如果方便,请您描述bug详情,如果代码报错,最好附上错误提示。

答:使用命令行安装,但是一直出现问题cannot import name 'etree' from 'lxml'
$ python3 -m weibo_spider
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "C:/Scoop/apps/msys2/2024-07-27/ucrt64/lib/python3.11/site-packages/weibo_spider/main.py", line 6, in
from weibo_spider.spider import main
File "C:/Scoop/apps/msys2/2024-07-27/ucrt64/lib/python3.11/site-packages/weibo_spider/spider.py", line 19, in
from .parser import AlbumParser, IndexParser, PageParser, PhotoParser
File "C:/Scoop/apps/msys2/2024-07-27/ucrt64/lib/python3.11/site-packages/weibo_spider/parser/init.py", line 1, in
from .index_parser import IndexParser
File "C:/Scoop/apps/msys2/2024-07-27/ucrt64/lib/python3.11/site-packages/weibo_spider/parser/index_parser.py", line 3, in
from .info_parser import InfoParser
File "C:/Scoop/apps/msys2/2024-07-27/ucrt64/lib/python3.11/site-packages/weibo_spider/parser/info_parser.py", line 6, in
from .util import handle_html
File "C:/Scoop/apps/msys2/2024-07-27/ucrt64/lib/python3.11/site-packages/weibo_spider/parser/util.py", line 7, in
from lxml import etree
ImportError: cannot import name 'etree' from 'lxml' (C:/Scoop/apps/msys2/2024-07-27/ucrt64/lib/python3.11/site-packages/lxml/init.py)

@Ehcochwy Ehcochwy added the bug label Nov 19, 2024
@dataabc
Copy link
Owner

dataabc commented Nov 19, 2024

@Ehcochwy
Copy link
Author

我把python版本从3.6换到3.11后此问题解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants