Enable Dark Mode!
configure-pycharm-odoo-development-windows.png
By: Linto

How to Configure PyCharm for Odoo Development in Windows?

Technical Odoo 10

Installing Odoo in windows is really an easy task. We can do it by just running the ‘.exe’ file. But for development purposes, this method is not preferred. Pycharm is an IDE that can be used for Odoo development in Windows, Linux, and mac. In this blog, we will discuss setting up the Odoo development environment in windows using pycharm. These are the steps we need to follow.

1. Download and install python 2.7 from here https://www.python.org/downloads/release/python-2713/

based on your system architecture.

2. After installing python, we need to install the Microsoft Visual C++ compiler.

Go to this link https://www.microsoft.com/en-us/download/details.aspx?id=44266

Download and install it.

3. Download PostgreSQL and configure.

https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#windows

Create a new user for Odoo:

You can either create a user (role) using the pgadmin or directly from the command prompt. For creating a user with pgadmin, first, configure pgadmin and then go to the roles section and create a new role. Then under the privileges tab of this role, provide all the access. From the command prompt, you can create the user with the following commands. First, go to the PostgreSQL installation directory using ‘cd’ (usually “C:\Program Files\PostgreSQL”)

cd "C:\Program Files\PostgreSQL\9.6\bin" 
(Here ‘9.6’ is my PostgreSQL version. Change it accordingly)
createuser.exe --createdb --username postgres --no-createrole --pwprompt odoo
You will be asked for the password, provide a password, and remember it. We may need it again during Odoo installation.4. Now download Pycharm from here https://www.jetbrains.com/pycharm/download/#section=windows and install.

5. Download odoo https://github.com/odoo/odoo/archive/10.0.zip and extract the contents to a folder.

6. Open pycharm and create a project with the folder which we have extracted in the last step.

7. Now we need to install some packages for odoo.In the extracted odoo folder, we can find a ‘requirements.txt’ file.

cd C:\ python27 
(change to the location where python is installed. You can also do this from any location if you add a python path to your system’s path variable. For this, go to My PC > Properties > Advanced System Settings > Environment Variables > and edit the path and add your python path)
python -m pip install -r C:\Users\Odoo-10.0\requirements.txt
(we have to specify the ‘requirements.txt’ file with its complete path.)

8. Download and install pywin32 from here.

https://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/

You need to download the correct version based on your system architecture and python.

Note that you cannot install 64 bit pywin32 on a system with 32-bit python installed. It will show an error saying that ‘Python is not found’.

9. Download and install pip. https://bootstrap.pypa.io/get-pip.pyDownload the file get-pip.py and move it to the python installation location.

cd C:\python27
python get-pip.py
10. Now we need to configure odoo.Open pycharm and edit the file ‘odoo-server.conf’ (usually, this file may be inside the Debian folder in odoo’s folder)Edit the contents like this,
; admin_passwd = admin
db_host = localhost
db_port = 5432
db_user = odoo
db_password =odoo (the password you have provided when the user is created)
addons_path = C:\Users\odoo10\addons
You can change the default port of odoo by using ‘xmlrpc_port = new port no.’11. Additional installations need to install some other features also, for working without errors. a) Install setup tools: From cmd, run
cd C:\python27
python -m pip install --upgrade setuptools
b) Install Wheel & Lxml-3.6.4-cp27-cp27m-win32.Whl
cd C:\python27
python -m pip install wheel
c) Go to this link http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml and then from a terminal,
python -m pip install lxml-3.6.4-cp27-cp27m-win32.whl
d) Install PSYCOPG2 from http://www.stickpeople.com/projects/python/win-psycopg/


e) Install nodejs

Go to https://nodejs.org/en/

cd C:\Program Files\nodejs (here you specify installation location nodejs)
npm install -g less less-plugin-clean-css

f) Install wkhtmltopdf from here https://wkhtmltopdf.org/downloads.html (I prefer using version 12.1)


12. Now we need to create a service with pycharm. For this, open pycharm, and under the run menu, go to the edit configurations option and click on the ‘+’ to create a new configuration, select python from the list.

Now we need to select script and script parameters. In the script field, select the odoo-bin file. In the script parameters section fill it like this,    

-c /path to odoo.conf 
file, i.e., for example, 
-c /home/odoo/odoo-10.0/odoo.conf. 
Now we can run Odoo from pycharm.
Learn the technical aspects of Odoo from the best in business. Cybrosys Technologies, the golden partner of Odoo offers courses for developers focusing on the technical aspects of the platform. Visit our Odoo Development Tutorial Page



If you need any assistance in odoo, we are online, please chat with us.



11
Comments

Richard

Please help me in this case what happen with me ! and how to fix it Traceback (most recent call last): File "C:/Users/cuong/Desktop/odoogithub/odoo-11.0/odoo-bin", line 5, in import odoo File "C:\Users\cuong\Desktop\odoogithub\odoo-11.0\odoo\__init__.py", line 84, in from . import modules File "C:\Users\cuong\Desktop\odoogithub\odoo-11.0\odoo\modules\__init__.py", line 8, in from . import db, graph, loading, migration, module, registry File "C:\Users\cuong\Desktop\odoogithub\odoo-11.0\odoo\modules\graph.py", line 10, in import odoo.tools as tools File "C:\Users\cuong\Desktop\odoogithub\odoo-11.0\odoo\tools\__init__.py", line 10, in from .convert import * File "C:\Users\cuong\Desktop\odoogithub\odoo-11.0\odoo\tools\convert.py", line 21, in from .translate import _ File "C:\Users\cuong\Desktop\odoogithub\odoo-11.0\odoo\tools\translate.py", line 24, in from .osutil import walksymlinks File "C:\Users\cuong\Desktop\odoogithub\odoo-11.0\odoo\tools\osutil.py", line 17, in import win32service as ws ImportError: DLL load failed: %1 is not a valid Win32 application.

30/08/2018

-

7:43PM

Nitish Khadaria

Hey Linto, can i development OpenERP v-7 in Window ?

26/07/2019

-

4:45AM

Nitish Khadaria

i cant find odoo-server.conf .

25/09/2019

-

11:25PM

binfile

Great post but I can't find odoo bin file, Can you please help me out?

24/10/2019

-

5:52AM

philip

Hi, i cant find odoo-bin file doesnt exist '.

22/11/2017

-

1:38AM

piccosoft

Your blog is very nice... Thanks for sharing your information...

19/07/2018

-

2:20AM

Mehmood Hussain

Hi Linto I followed above steps after step 12 when run odoo in pycharm then following error showing C:\Python27\python.exe C:/odoo-10.0/odoo-bin -c /odoo-10.0/debian/odoo.conf 2018-06-19 10:02:42,200 8136 INFO ? odoo: Odoo version 10.0 2018-06-19 10:02:42,200 8136 INFO ? odoo: Using configuration file at C:\odoo-10.0\debian\odoo.conf 2018-06-19 10:02:42,200 8136 INFO ? odoo: addons paths: [u'C:\\Users\\Mega IT\\AppData\\Local\\OpenERP S.A.\\Odoo\\addons\\10.0', u'C:\\odoo-10.0\\addons', 'C:\\odoo-10.0\\odoo\\addons'] 2018-06-19 10:02:42,201 8136 INFO ? odoo: database: odoo@localhost:5432 2018-06-19 10:02:42,242 8136 INFO ? odoo.service.server: HTTP service (werkzeug) running on Megaline:8069 Process finished with exit code -1

19/06/2018

-

3:08AM

Aymar Le Pere

Thank you all for your comment but i stll have a problem. What should i put in the script parameters section when in the run configuration of pycharm ?

11/07/2019

-

11:45PM

Jesus pozzo

Hi Boys , and how can I access the orme by console? I am using windows and pycharm try placing odoo-bin shell and it gives me error

10/08/2018

-

8:15AM

Gediminas

hey can you help me i get this when creating password here is cmd : C:\Program Files\PostgreSQL\11\bin>createuser.exe --createdb --username postgres --no-createrole --pwprompt odoo Enter password for new role: Enter it again: Password: createuser: could not connect to database postgres: FATAL: password authentication failed for user "postgres"

06/03/2019

-

1:49PM

Michel Valenzuela

Simply, excellent tutorial.

01/02/2019

-

10:50AM



Leave a comment

 


whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message