Zalino Logo white

How to Configure Odoo 17 in Pycharm Using Virtual Environment

Odoo Image with Pycharm
How to Configure Odoo 17 Development Environment in Pycharm Using Virtual Environment

To configure Odoo in PyCharm using a virtual environment, follow these steps:

1. Download odoo & Install Odoo Dependencies
First of all download and install the odoo dependencie. If you have not yet installed it please follow the following steps: How to Install Odoo 17 on Linux/Ubuntu Server Using Virtual Environment
2. Install PyCharm via Snap (Recommended)
The easiest way to install PyCharm on Ubuntu is by using Snap. Snap packages are maintained by the developers of PyCharm, so this is a reliable method.
Run the following command to install the PyCharm Community edition (free version):

sudo snap install pycharm-community --classic

    

If you want the Professional edition (paid version), run this command instead:

sudo snap install pycharm-professional --classic

    
3. Configure PyCharm
  • Open PyCharm and load the Odoo project.

  • Configure the virtual environment:

    • Go to File > Settings (or Preferences on macOS).
    • Navigate to Project: <Your Project Name> > Python Interpreter.
    • Click the gear icon next to the interpreter list and select Add.
    • Choose Existing environment and select the virtual environment’s Python executable:
      • Linux/macOS: venv/bin/python
      • Windows: venv/Scripts/python.exe
    • Click OK to add it.
  • Configure Odoo Run/Debug Configuration:

    • Go to Run > Edit Configurations.
    • Click the + icon to add a new configuration and select Python.
    • Set the following:
      • Name: Odoo
      • Script path: Path to odoo-bin (e.g., /path/to/odoo/odoo-bin)
      • Parameters: (e.g., -c /path/to/odoo.conf if you are using a configuration file)
      • Python interpreter: Select the virtual environment you configured earlier.
  • Set Environment Variables (Optional): If you need to set environment variables (e.g., ODOO_CONF), you can add them in the Run/Debug Configuration under the Environment Variables section.

Pycharm Configuration Add Interprator Image
Pycharm Configuration Image
4. Running Odoo
You can now run Odoo from within PyCharm by clicking the Run button or debugging as needed. if you see the local ip and port number in debugging then it is ready to use and everything is working fine and we are good to go for development.
Pycharm Dashboard Image

By configuring Odoo in this way, you ensure that your development environment is isolated and dependencies are well managed.

One Response

Leave a Reply

Your email address will not be published. Required fields are marked *