This question has been flagged
8 Replies
8273 Views

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
Discard
Best Answer

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
Discard
Author

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.

Best Answer

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
Discard
Best Answer
it will use the one you have on "odoo\python" folder
Avatar
Discard
Author

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.

Author

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