Setting up Odoo development environment in windows using PyCharm
In this tutorial I will discuss how to configure PyCharm with Odoo in windows environment. You have to follow below steps to configure PyCharm with Odoo.- Download python 2.7.16 or above version
- Install python 2.7.16
- Setting the environment variable for python
- After installing python, we need to Download Microsoft Visual C++ Compiler
- Install above Microsoft Visual C++ Compiler
- Download PostgreSQL and install it
- After installing PostgreSQL, create user (role) from pgAdmin or by using command prompt using following code.
createuser.exe --createdb --username postgres --no-createrole --pwprompt odoo
- Download PyCharm
- Download latest Odoo 8 version Source (Zip File)
- Extract above Odoo8 zip file
- Open PyCharm and create a new "Pure Python" project, with the folder which we have extracted.
- Setting python interpreter as your desired python in our case its 2.7.16. To do this go to "File" menu and click on "Setting". Now click on "Project Interpreter" on the left side of given menus and set your desired version of python from drop-down on the right hand side of the box.
- To run Odoo server now we need to edit configuration in our PyCharm project, the purpose of doing this activity is we are going to tell the PyCharm that, how to run our project? In this case we need to configure on which basis run Odoo server, to do this go "Run" menu and click "Edit Configuration".
- Setting up Odoo Configuration File
If you did not have this file in your downloaded Odoo source folder than, create a new file named "openerp-server" with ".conf" extension and copy above code and paste it in your newly created file.
- Now in last step we are going to install python libraries and site packages. Fortunately Odoo Source has a text file (requirements.txt) of all the required python packages with name and their version. We just need to pip install this text file using below command.
python -m pip install -r requirements.txt
Now restart the odoo services, if you got any error related to python packages, just install this package using pip.
pip install pywin32
Now we can run Odoo from PyCharm.