Skip to Content
Menu
This question has been flagged
2 Replies
6527 Views

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 ?




 







Avatar
Discard

Hello, May be usefull

~/odoo/odoo-10.0$ python odoo-bin --addons-path=addons,/location/your/custome/module--xmlrpc-port=8069 --db-filter your_db_name -d your_db_name -u custome_module

~/odoo/odoo-11.0$ python odoo-bin --addons-path=addons,/location/your/custome/module--xmlrpc-port=8069 --db-filter your_db_name -d your_db_name -u custome_module

Best Answer

use virtualenv for each for your own sake.

for v10: place venv somewhere

$ virtualenv -p /usr/bin/python2 venv-odoo10

$ source venv-odoo10/bin/activate

$ pip install --no-cache-dir -r requirements.txt


for v11: place venv somewhere

$ virtualenv -p /usr/bin/python3 venv-odoo11

$ source venv-odoo11/bin/activate

$ pip install --no-cache-dir -r requirements.txt

if you are using postgres 10, in requirements.txt, set version to

psycopg2==2.7.4;


this is not only limited to odoo, any python app you run, use virtualenv.

Avatar
Discard
Related Posts Replies Views Activity
2
Jul 24
12604
1
Jul 21
6667
0
Mar 21
5198
3
Jul 20
18529
0
Apr 20
3412