Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How to run Odoo 18E with venv ?

Odoberať

Get notified when there's activity on this post

This question has been flagged
pythonvenv
3 Replies
471 Zobrazenia
Avatar
Vincèn PUJOL

Hi


I'm killing my head trying to get Odoo 18 Enterprise to run in a Python venv due to dependencies for some modules.

I have tried to run Odoo using the python of the venv but it doesn't work, same if I modify the systemd init script.

Installation is done on Debian 12 using deb packages supplied by Odoo.


Thanks


Vincèn

0
Avatar
Zrušiť
Kunjan Patel

Hello,
It exists on your server: /opt/odoo/odoo-bin
Run this to confirm:
ls -la /opt/odoo/odoo-bin
If you downloaded a different archive missing it, just create it:
cat > /opt/odoo/odoo-bin << 'EOF'
#!/usr/bin/env python3
__import__('os').environ['TZ'] = 'UTC'
import odoo
if __name__ == "__main__":
odoo.cli.main()
EOF
chmod +x /opt/odoo/odoo-bin

Vincèn PUJOL
Autor

in /opt/odoo I have only a subdirectory odoo where are all files coming from Odoo archive for source and my venv directory !
What you describe as content for odoo-bin is the content I have in the odoo file in the subdirectory /opt/odoo/odoo/setup
Sorry but I'm completely lost now about what to do

Codesphere Tech

Hello,
Provide details here about what you have done and what you want to achieve?

Kunjan Patel

Hello, can you try that
sudo sed -i 's|/opt/odoo/odoo/setup/odoo|/opt/odoo/odoo-bin|' /etc/systemd/system/odoo.service && sudo systemctl daemon-reload && sudo systemctl restart odoo

Vincèn PUJOL
Autor

Well my goal is to be able to run Odoo 18 Enterprise with venv Python environnment so I can install some Python dependencies in venv needed for some extra modules in Odoo !
So far, I have tried multiple ways using either the deb supplied by Odoo or the source archive supplied by Odoo. I have created an odoo user in a clean debian 12 install, copied the extracted archive supplied by odoo into it, installed a venv in the odoo user and created a sysinit file to start odoo using the venv environnment. Whatever I do it using the deb package or the source archive I end up with the same error listed in my previous message !

Vincèn PUJOL
Autor

I tried the command line you shared but still same error:

root@odoo18:~# systemctl status odoo
× odoo.service - Odoo
Loaded: loaded (/etc/systemd/system/odoo.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Wed 2025-12-10 12:15:54 CET; 11s ago
Duration: 9ms
Process: 143059 ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo-bin -c /etc/odoo.conf (code=exited, status=1/FAILURE)
Main PID: 143059 (code=exited, status=1/FAILURE)
CPU: 9ms

déc 10 12:15:54 odoo18 systemd[1]: Started odoo.service - Odoo.
déc 10 12:15:54 odoo18 odoo[143059]: Traceback (most recent call last):
déc 10 12:15:54 odoo18 odoo[143059]: File "/opt/odoo/odoo-bin", line 8, in <module>
déc 10 12:15:54 odoo18 odoo[143059]: odoo.cli.main()
déc 10 12:15:54 odoo18 odoo[143059]: ^^^^^^^^
déc 10 12:15:54 odoo18 odoo[143059]: AttributeError: module 'odoo' has no attribute 'cli'
déc 10 12:15:54 odoo18 systemd[1]: odoo.service: Main process exited, code=exited, status=1/FAILURE
déc 10 12:15:54 odoo18 systemd[1]: odoo.service: Failed with result 'exit-code'.
root@odoo18:~#

Codesphere Tech

Ok some questions in my mind
Why you want to use venv only for enterprise?
Extra modules meaning in this context?
Have you tried with this "source venv/bin/activate"?

Vincèn PUJOL
Autor

Hi @codsphere tech

Not sure to understand your question about venv only for Odoo Enterprise ??
Extra modules means some apps made by third parties (Odoo partners) that I want to install in Odoo and that have some Python dependencies that only exists in pip3 and not in Python itself and so needs Odoo to run in venv.
I have tried already the activate before trying to start Odoo but no changes, same error :(

Kunjan Patel

Hello,
Odoo not installed in venv. Fix:
source /opt/odoo/odoo-venv/bin/activate
pip install -e /opt/odoo
deactivate
sudo systemctl restart odoo

Or add PYTHONPATH to service file:
sudo systemctl edit odoo
[Service]
Environment="PYTHONPATH=/opt/odoo"

sudo systemctl daemon-reload && sudo systemctl restart odoo

hope it helps

Codesphere Tech

If you are not using multiple versions on the same server then you can install dependencies using pip install module_name..
First try without extra modules and if the odoo start then you can add that modules.

ExecStart= /pathofyourvirtualenv/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf

Vincèn PUJOL
Autor

Hi Kunjan

I added as you suggested the Python path variable in init script file but still the exact same error at startup :(
For venv it's well installed in odoo home directory already.

Hi Codesphere,

It's exactly what I'm trying to do since days without any success. I'm unable to run Odoo in a venv environnment, it always fails whatever I'm using the deb supplied by Odoo or the zip archive.

I'n also very confused why all Odoo documentations or tutorials on Internet speaks about odoo-bin file that doesn't exist neither in the deb version neither in the zip file of sources....

Vincèn PUJOL
Autor

No more ideas about what the problem is ?

Codesphere Tech

If it is possible in your case, try with cloning the odoo addons.

Vincèn PUJOL
Autor

Cloning addons ? my main problem is to be able to use Odoo with pip dependencies which so far doesn't work being unable to get Odoo work with venv !

Kunjan Patel

Deb Package
/usr/bin/odoo -c /etc/odoo/odoo.conf

venv (Use Git instead)
git clone https://github.com/odoo/odoo.git --depth 1 --branch 18.0
cd odoo
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
./odoo-bin
Deb + venv = Don't mix. Use Git for venv.

hope it helps.

Vincèn PUJOL
Autor

Hi Kunjan

Thanks for your email but unhappy I'm "just" an Odoo customer and not a partner so no access at Odoo Github for Enterprise version and if I use the source archives supplied by Odoo it doesn't work :(

Vincèn

Avatar
Kunjan Patel
Best Answer
Hello Vincen PUJOL,
I hope you are doing well

sudo python3 -m venv /opt/odoo-venv
sudo chown -R odoo:odoo /opt/odoo-venv
sudo -u odoo /opt/odoo-venv/bin/pip install -r /usr/lib/python3/dist-packages/odoo/requirements.txt
sudo SYSTEMD_EDITOR=tee systemctl edit odoo <<< $'[Service]\nExecStart=\nExecStart=/opt/odoo-venv/bin/python3 /usr/bin/odoo --config=/etc/odoo/odoo.conf
sudo systemctl daemon-reload && sudo systemctl restart odoo

I hope this information helps you 

Thanks & Regards,
Kunjan Patel
1
Avatar
Zrušiť
Vincèn PUJOL
Autor

Hi Kunjan

Thanks a lot for your message that confirms I follow the good procedure but it doesn't work. Only difference between your method and mine is that I created the venv in the odoo user account.

My systemd file:
[Unit]
Description=Odoo
Requires=postgresql.service
After=network.target postgresql.service

[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo/setup/odoo -c /etc/odoo.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

and always get that error when trying to start odoo using systemd:

root@odoo18:/opt/odoo/odoo/setup# systemctl status odoo
× odoo.service - Odoo
Loaded: loaded (/etc/systemd/system/odoo.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Wed 2025-12-10 08:36:54 CET; 4s ago
Duration: 12ms
Process: 88943 ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo/setup/odoo -c /etc/odoo.conf (code=exited, status=1/FAILURE)
Main PID: 88943 (code=exited, status=1/FAILURE)
CPU: 11ms

déc 10 08:36:54 odoo18 systemd[1]: Started odoo.service - Odoo.
déc 10 08:36:54 odoo18 odoo[88943]: Traceback (most recent call last):
déc 10 08:36:54 odoo18 odoo[88943]: File "/opt/odoo/odoo/setup/odoo", line 5, in <module>
déc 10 08:36:54 odoo18 odoo[88943]: import odoo
déc 10 08:36:54 odoo18 odoo[88943]: ModuleNotFoundError: No module named 'odoo'
déc 10 08:36:54 odoo18 systemd[1]: odoo.service: Main process exited, code=exited, status=1/FAILURE
déc 10 08:36:54 odoo18 systemd[1]: odoo.service: Failed with result 'exit-code'.

root@odoo18:/opt/odoo/odoo/setup#

I'm not sure what I can try now as I have always that error whatever I try with the deb packages or the source archive file :(

Vincèn PUJOL
Autor

I'm surprised also that all documentations talk about an odoo-bin file while there is only an odoo file in archive offered by Odoo for download....

Vincèn PUJOL
Autor

Thanks for your help but there is no odoo-bin in the source file downloaded from Odoo website...

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,

Running Odoo 18 inside a Python virtual environment is fully supported and helps keep dependencies isolated from your system. The idea is simple: create a venv, install Odoo’s Python requirements inside it, and run Odoo using the venv’s Python instead of the system one.

To do that:

    Create and activate the venv using python3 -m venv venv and source venv/bin/activate.

    Install dependencies inside the venv: pip install -r requirements.txt.

    Start Odoo using the venv interpreter: ./odoo-bin -c /path/to/odoo.conf.

If you run Odoo as a service, just point the systemd service to the venv’s Python path. This keeps the environment clean and avoids version conflicts.

This blog might help you: https://www.cybrosys.com/blog/how-to-setup-odoo-18-development-environment-using-pycharm-in-ubuntu-22-04


Hope it helps

0
Avatar
Zrušiť
Vincèn PUJOL
Autor

Hi

Thanks a lot for your post but I know it'll fail as there is no odoo-bin file in the source archive supplied by Odoo and your documentation mentions only odoo-bin to start Odoo !!

Best,
Vincèn

Avatar
Vincèn PUJOL
Autor Best Answer

Hi Kunjan

Thanks a lot for your message that confirms I follow the good procedure but it doesn't work. Only difference between your method and mine is that I created the venv in the odoo user account.

My systemd file:

[Unit]
Description=Odoo
Requires=postgresql.service
After=network.target postgresql.service

[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo/setup/odoo -c /etc/odoo.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target


and always get that error when trying to start odoo using systemd:


root@odoo18:/opt/odoo/odoo/setup# systemctl status odoo
× odoo.service - Odoo
     Loaded: loaded (/etc/systemd/system/odoo.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Wed 2025-12-10 08:36:54 CET; 4s ago
   Duration: 12ms
    Process: 88943 ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo/setup/odoo -c /etc/odoo.conf (code=exited, status=1/FAILURE)
   Main PID: 88943 (code=exited, status=1/FAILURE)
        CPU: 11ms

déc 10 08:36:54 odoo18 systemd[1]: Started odoo.service - Odoo.
déc 10 08:36:54 odoo18 odoo[88943]: Traceback (most recent call last):
déc 10 08:36:54 odoo18 odoo[88943]:   File "/opt/odoo/odoo/setup/odoo", line 5, in <module>
déc 10 08:36:54 odoo18 odoo[88943]:     import odoo
déc 10 08:36:54 odoo18 odoo[88943]: ModuleNotFoundError: No module named 'odoo'
déc 10 08:36:54 odoo18 systemd[1]: odoo.service: Main process exited, code=exited, status=1/FAILURE
déc 10 08:36:54 odoo18 systemd[1]: odoo.service: Failed with result 'exit-code'.

root@odoo18:/opt/odoo/odoo/setup#


I'm not sure what I can try now as I have always that error whatever I try with the deb packages or the source archive file :(

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
new python env
python
Avatar
0
mar 25
2529
What means "Too many values to unpack" message? Solved
python
Avatar
Avatar
Avatar
Avatar
Avatar
4
apr 24
176258
have no data in screen. read data in my own module from different model
python
Avatar
0
dec 23
3158
How to insert value to a one2many field in table with create method? Solved
python
Avatar
Avatar
Avatar
Avatar
Avatar
5
júl 25
232976
how to disable add product in sales of odoo 12
python
Avatar
Avatar
1
dec 22
4380
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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