Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

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

Subscribe

Get notified when there's activity on this post

This question has been flagged
ubuntuserverlxmlv17
1 Reply
15326 Views
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
Discard
Avatar
NGHEZAL
Author 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
Discard
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!

Sign up
Related Posts Replies Views Activity
Ya es posible hacer Upgrade de v17 a v17.1 ?
v17
Avatar
Avatar
1
Oct 25
1303
How to add a new Many2one field in res.config.settings? Solved
v17
Avatar
Avatar
Avatar
Avatar
4
Oct 25
3695
Add field to ALL models in Odoo
v17
Avatar
Avatar
Avatar
2
Sep 25
2366
How to disable Email notification - You have been assigned to Solved
v17
Avatar
Avatar
Avatar
Avatar
4
Sep 25
7758
Selection Field Options Disappear from Database (PostgreSQL enum) on Module Upgrade
v17
Avatar
0
Aug 25
1255
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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