1
votes

I installed python 2.7 and 3.4 on my local machine and on the server. Also installed Odoo 10. and 11.0 on the same machine. I created modules for Odoo 10 and 11, executed successfully. But when I upload Odoo 11 code to server getting an error.

Example, the print statement I typed print'Test Print' in both Odoo 10 & 11.0. It worked without any error on the local machine. But got an error on the server.

I checked the version on both machines, the output is:

python -V
Python 2.7.12

python3 -V
Python 3.5.2

How can I tell Odoo to choose correct python version while compiling the code ?

2

2 Answers

2
votes

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 print "Test Print"

but in Python3 print is consider as function so you must have to write

print("Test Print") 

you can start odoo server For Odoo 10:

python2 odoo-bin

For Odoo 11:

python3 odoo-bin
0
votes

In odoo11: print("Test Print")

In odoo10: print "Test Print"

For running odoo10 or odoo11, you have to clear the browser history or run on the private window.

Because the browser has odoo 10 or 11 existing histories.