Skip to Content
Menu
This question has been flagged
1 Reply
12785 Views

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.
 


Avatar
Discard
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 ::::

Avatar
Discard

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

Related Posts Replies Views Activity
4
May 25
1417
2
May 25
4826
1
Mar 25
892
4
Mar 25
3602
3
Feb 25
4357