Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Odoo 17 install bug "AttributeError: module 'lxml.html.clean' has no attribute 'defs'"

Subscriure's

Get notified when there's activity on this post

This question has been flagged
ubuntuserverlxmlv17
1 Respondre
15710 Vistes
Avatar
NGHEZAL

Ubuntu server 22 :

  1. Hi there I'm trying deploying odoo 17 for the first time on ubuntu server whith python virtual environnement, but it fails :
  2. (odoo_env) root@srv-b:/home/nabadmin/odoo17# python3 -m pip show lxml

    Name: lxml

    Version: 5.2.1

    Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.

    Home-page: https://lxml.de/

    Author: lxml dev team

    Author-email: lxml-dev@lxml.de

    License: BSD-3-Clause

    Location: /home/nabadmin/odoo17/odoo_env/lib/python3.10/site-packages

    Requires: 

    Required-by: lxml_html_clean

    (odoo_env) root@srv-b:/home/nabadmin/odoo17# pip install lxml==

    -bash: syntax error near unexpected token `newline'

    (odoo_env) root@srv-b:/home/nabadmin/odoo17# pip install lxml==4.6.3

    Collecting lxml==4.6.3

      Downloading lxml-4.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (6.9 MB)

         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.9/6.9 MB 14.3 MB/s eta 0:00:00

    Installing collected packages: lxml

      Attempting uninstall: lxml

        Found existing installation: lxml 5.2.1

        Uninstalling lxml-5.2.1:

          Successfully uninstalled lxml-5.2.1

    Successfully installed lxml-4.6.3

    (odoo_env) root@srv-b:/home/nabadmin/odoo17# sudo systemctl restart odoo

    (odoo_env) root@srv-b:/home/nabadmin/odoo17# sudo systemctl status odoo

    × odoo.service - Odoo Open Source ERP and CRM

         Loaded: loaded (/lib/systemd/system/odoo.service; enabled; vendor preset: enabled)

        Drop-In: /run/systemd/system/service.d

                 └─zzz-lxc-service.conf

         Active: failed (Result: exit-code) since Fri 2024-04-12 21:41:03 CEST; 9s ago

        Process: 670518 ExecStart=/usr/bin/odoo --config /etc/odoo/odoo.conf --logfile /var/log/odoo/odoo-server.log (code=exited, status=1/FAILURE)

       Main PID: 670518 (code=exited, status=1/FAILURE)

            CPU: 912ms


    avril 12 21:41:03 srv-b.democrasite.com odoo[670518]:     from . import db, graph, loading, migration, module, registry, neutralize

    avril 12 21:41:03 srv-b.democrasite.com odoo[670518]:   File "/usr/lib/python3/dist-packages/odoo/modules/graph.py", line 11, in

    avril 12 21:41:03 srv-b.democrasite.com odoo[670518]:     import odoo.tools as tools

    avril 12 21:41:03 srv-b.democrasite.com odoo[670518]:   File "/usr/lib/python3/dist-packages/odoo/tools/__init__.py", line 24, in

    avril 12 21:41:03 srv-b.democrasite.com odoo[670518]:     from .mail import *

    avril 12 21:41:03 srv-b.democrasite.com odoo[670518]:   File "/usr/lib/python3/dist-packages/odoo/tools/mail.py", line 32, in

    avril 12 21:41:03 srv-b.democrasite.com odoo[670518]:     safe_attrs = clean.defs.safe_attrs | frozenset(

    avril 12 21:41:03 srv-b.democrasite.com odoo[670518]: AttributeError: module 'lxml.html.clean' has no attribute 'defs'

    avril 12 21:41:03 srv-b.democrasite.com systemd[1]: odoo.service: Main process exited, code=exited, status=1/FAILURE

    avril 12 21:41:03 srv-b.democrasite.com systemd[1]: odoo.service: Failed with result 'exit-code'.

cat /home/nabadmin/odoo17/requirements.txt

lxml==5.2.1

lxml_html_clean==0.1.1


Version seems ok, I don't know what to do more .

Thanks for your help.
 


1
Avatar
Descartar
Avatar
NGHEZAL
Autor Best Answer

::: SOLVED ::::

Long battle, 3 purges and re-install… Finally the problem was "lxml  5.2.1 downgrade to => 4.8.0 : 

root@srv-b:/var/log/odoo# pip list | grep lxml

lxml                5.2.1

lxml_html_clean     0.1.1

root@srv-b:/var/log/odoo# pip uninstall lxml

Found existing installation: lxml 5.2.1

Uninstalling lxml-5.2.1:

  Would remove:

    /usr/local/lib/python3.10/dist-packages/lxml-5.2.1.dist-info/*

    /usr/local/lib/python3.10/dist-packages/lxml/*

Proceed (Y/n)? Y

  Successfully uninstalled lxml-5.2.1

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

root@srv-b:/var/log/odoo# pip list | grep lxml

lxml                4.8.0

lxml_html_clean     0.1.1

Time for me to explore now Odoo…

:::: SOLVED ::::

3
Avatar
Descartar
Ermias Tegegn Retta - Ethiopia

Thanks @NGHEZAL, it worked for me but one more thing to add:
after uninstalling lxml 5.2.1
install lxml 4.8.0 by using the below code
pip install lxml==4.8.0

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Ya es posible hacer Upgrade de v17 a v17.1 ?
v17
Avatar
Avatar
1
d’oct. 25
1461
How to add a new Many2one field in res.config.settings? Solved
v17
Avatar
Avatar
Avatar
Avatar
4
d’oct. 25
4101
Add field to ALL models in Odoo
v17
Avatar
Avatar
Avatar
2
de set. 25
2654
How to disable Email notification - You have been assigned to Solved
v17
Avatar
Avatar
Avatar
Avatar
4
de set. 25
8204
Selection Field Options Disappear from Database (PostgreSQL enum) on Module Upgrade
v17
Avatar
0
d’ag. 25
1448
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now