Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
8 Odpowiedzi
9835 Widoki

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



Awatar
Odrzuć
Najlepsza odpowiedź

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.

 

Awatar
Odrzuć
Autor

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.

Najlepsza odpowiedź

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.

Awatar
Odrzuć
Najlepsza odpowiedź
it will use the one you have on "odoo\python" folder
Awatar
Odrzuć
Autor

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.

Autor

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

Powiązane posty Odpowiedzi Widoki Czynność
1
maj 22
9154
0
lis 20
2350
1
sie 18
12547
1
sie 18
9752
0
lut 23
1843