Hi all,
I've just got into Odoo and was impressed with it after hosting it on my previous VPS. Everything worked fine and then install was smooth from the Source Install instruction on the Odoo documentation site.
I've since then wiped that server and started it again as I've decided to use it as a dedicated utility server with Odoo.
After a fresh install reimagine I've not been able to get to running Odoo. I get this error relating to LXML.
Error processing line 1 of /usr/lib/python3/dist-packages/distutils-precedence.pth:
Traceback (most recent call last):
File "", line 201, in addpackage
File "", line 1, in
ModuleNotFoundError: No module named '_distutils_hack'
Remainder of file ignored
Traceback (most recent call last):
File "/var/www/accounts/odoo/odoo-bin", line 5, in
import odoo
File "/var/www/accounts/odoo/odoo/__init__.py", line 134, in
from . import modules
File "/var/www/accounts/odoo/odoo/modules/__init__.py", line 8, in
from . import db, graph, loading, migration, module, registry, neutralize
File "/var/www/accounts/odoo/odoo/modules/graph.py", line 11, in
import odoo.tools as tools
File "/var/www/accounts/odoo/odoo/tools/__init__.py", line 24, in
from .mail import *
File "/var/www/accounts/odoo/odoo/tools/mail.py", line 19, in
from lxml.html import clean, defs
File "/usr/lib/python3/dist-packages/lxml/html/clean.py", line 18, in
raise ImportError(
ImportError: lxml.html.clean module is now a separate project lxml_html_clean.
Install lxml[html_clean] or lxml_html_clean directly.
I've read that there's currently an issue with Odoo and Python 3.12. But I was able to install this only a week ago for testing. I haven't got much on the previous server setup as it was a testing/staging server so was a mess.
I'm not too great with Python and this is the first time I've come across issues such as these. If anyones got any insight that would be great.
Ubuntu 24.04 noble
Python 3.12.3
Apache2 2.4.58
Thanks.
Thanks to Savya Sachin I've made some progress, I've taken both points on board and adjusted the requirements.txt file for the installed versions. But now I've got further errors.
Error processing line 1 of /usr/lib/python3/dist-packages/distutils-precedence.pth:
Traceback (most recent call last):
File "<frozen site>", line 201, in addpackage
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named '_distutils_hack'
Remainder of file ignored
Traceback (most recent call last):
File "/var/www/accounts/odoo/odoo-bin", line 5, in <module>
import odoo
File "/var/www/accounts/odoo/odoo/__init__.py", line 134, in <module>
from . import modules
File "/var/www/accounts/odoo/odoo/modules/__init__.py", line 8, in <module>
from . import db, graph, loading, migration, module, registry, neutralize
File "/var/www/accounts/odoo/odoo/modules/graph.py", line 11, in <module>
import odoo.tools as tools
File "/var/www/accounts/odoo/odoo/tools/__init__.py", line 15, in <module>
from . import pdf
File "/var/www/accounts/odoo/odoo/tools/pdf.py", line 46, in <module>
from odoo.tools.misc import file_open
File "/var/www/accounts/odoo/odoo/tools/misc.py", line 43, in <module>
from lxml import etree
ModuleNotFoundError: No module named 'lxml'
I've gone through 'requirements.txt' and pointed lxml to the installed version 5.2.2 (this is what is listed on the pip -list as an installed module.
Thank you again. Olivier pointing out something further, I've now rolled back from python 3.12 to 3.10.4
Still getting so many errors though of missing packages.
Is there something that I've completely missed from my previous install only a week ago? Let me know if you need more information as I'd love to get odoo working in an environment again.
Traceback (most recent call last):
File "/var/www/accounts/odoo/odoo-bin", line 5, in <module>
import odoo
File "/var/www/accounts/odoo/odoo/__init__.py", line 134, in <module>
from . import modules
File "/var/www/accounts/odoo/odoo/modules/__init__.py", line 8, in <module>
from . import db, graph, loading, migration, module, registry, neutralize
File "/var/www/accounts/odoo/odoo/modules/graph.py", line 11, in <module>
import odoo.tools as tools
File "/var/www/accounts/odoo/odoo/tools/__init__.py", line 15, in <module>
from . import pdf
File "/var/www/accounts/odoo/odoo/tools/pdf.py", line 10, in <module>
from PIL import Image, PdfImagePlugin
File "/usr/lib/python3/dist-packages/PIL/Image.py", line 84, in <module>
from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/usr/lib/python3/dist-packages/PIL/__init__.py)
In your odoo folder find the requirements.txt file and check for the packages lxml, pillow and any package names which are shown as not installed in the log. install the exact versions as mentioned in the txt file
Pillow==9.0.1
lxml==4.8.0
Installing odoo 17: https://www.youtube.com/watch?v=sEQXJ_JHyMg
Installing odoo 17: https://www.youtube.com/watch?v=sEQXJ_JHyMg