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

Error while installing lxml #163370

Closed
Avi30000 opened this issue Apr 25, 2024 · 8 comments
Closed

Error while installing lxml #163370

Avi30000 opened this issue Apr 25, 2024 · 8 comments

Comments

@Avi30000
Copy link

Avi30000 commented Apr 25, 2024

Please someone help to fix this for me.

C:\Python310\python.exe C:\Users\Sequel\Downloads\odoo-16.0\odoo-16.0\odoo-bin -c odoo.conf
Traceback (most recent call last):
File "C:\Users\Sequel\Downloads\odoo-16.0\odoo-16.0\odoo-bin", line 5, in
import odoo
File "C:\Users\Sequel\Downloads\odoo-16.0\odoo-16.0\odoo_init_.py", line 134, in
from . import modules
File "C:\Users\Sequel\Downloads\odoo-16.0\odoo-16.0\odoo\modules_init_.py", line 8, in
from . import db, graph, loading, migration, module, registry, neutralize
File "C:\Users\Sequel\Downloads\odoo-16.0\odoo-16.0\odoo\modules\graph.py", line 10, in
import odoo.tools as tools
File "C:\Users\Sequel\Downloads\odoo-16.0\odoo-16.0\odoo\tools_init_.py", line 24, in
from .mail import *
File "C:\Users\Sequel\Downloads\odoo-16.0\odoo-16.0\odoo\tools\mail.py", line 32, in
safe_attrs = clean.defs.safe_attrs | frozenset(
AttributeError: module 'lxml.html.clean' has no attribute 'defs'

Process finished with exit code 1

@lathama
Copy link
Contributor

lathama commented Apr 26, 2024

The lxml package was broken up recently install lxml-html-clean to fix the issue.

@lathama
Copy link
Contributor

lathama commented Apr 26, 2024

Related #163429

@lathama
Copy link
Contributor

lathama commented Apr 26, 2024

Related #157950

@lathama
Copy link
Contributor

lathama commented Apr 26, 2024

@Avi30000
Copy link
Author

Thanks a lot, appreciate it, this is the first time am trying without any knowledge or experience of python, pycharm, etc.

@vava-odoo
Copy link
Contributor

Thanks @lathama

@leio
Copy link

leio commented May 6, 2024

Installing python3-lxml-html-clean on e.g. Ubuntu 24.04 LTS is not sufficient, as with it lxml.html.clean.defs does not exist as it's in a separate module now. Odoo should have accessed html.defs instead of clean.defs in the first place in odoo/tools/mail.py, which should work with old lxml as well. I believe clean.defs working with old lxml is more of an accident, as e.g. help(clean.defs) after doing the same imports points at lxml.html.defs documentation.

No PR will be forthcoming from me, as I will not be signing a CLA, but hopefully it helps someone stumbling on this.

@leio
Copy link

leio commented May 6, 2024

I found #161366 existing for this already.

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

No branches or pull requests

4 participants