Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
8 Antwoorden
9668 Weergaven

Hi,

 I am trying to run Odoo10 and Odoo12 on the same server, I did following configuration.

  1. Installed Python2.x and Python 3.x

  2. Downloaded Odoo 10 and 12

  3. And installed all dependencies

  4. Created two configuration files with two different ports

  5. And run on terminal like

    1. python <path_to_odoo_bin/./odoo-bin --conif=/etc/odoo10.conf

    2. python3 <path_to_odoo_bin/./odoo-bin --conif=/etc/odoo12.conf


    So far everything is working fine.

  6. My questions is, I need to run odoo as services like

  7.    sudo /etc/init.d/odoo10.server start

  8. and 

  9.    sudo /etc/init.d/odoo12.server start

  10. How can i tell Odoo to choose correct python version?

  11. ie, Odoo 10 = python2.x and Odoo12 = Python3.x



Avatar
Annuleer
Beste antwoord

First off all let me make you clear that python2 and 3 use different syntax for print In Python2 print is consider as statement so you can write initial command. but in Python3 print is consider as function so you must have to write.

 

Avatar
Annuleer
Auteur

I think you didn't understand my question. I would like to run Odoo 10 and 12 as services. i created two separate conf files and two services files for each version. And i started both services but only Odoo 10 is running, not Odoo12.

When i type python -V in terminal i get `Python 2.7.15rc1`. Because i think odoo 12 trying to run on python2.x instead of python3.x, How can I resolve this.

Beste antwoord

try playing with the environmental variables in your service script.

which python
which pyhon3

if python is your python2, python3 is your python3, in the service script at init.d/odoo-server

There should be something like PATH=/bin:/sbin:/usr/bin . 

Change the order of that see if that helps.

Avatar
Annuleer
Beste antwoord
it will use the one you have on "odoo\python" folder
Avatar
Annuleer
Auteur

Could you explain more?

On your odoo installation folder, there's a folder called python. Here it is where it takes python version. Another way that you can choose the version is running odoo through an IDE (like Pycharm) and configuring that.

Auteur

I do not have any python folder inside Odoo folder?

What am i missing?

Sorry might be different on Linux, as it has native python

Gerelateerde posts Antwoorden Weergaven Activiteit
1
mei 22
8983
0
nov. 20
2221
1
aug. 18
12421
1
aug. 18
9617
0
feb. 23
1732