How to Install Odoo on Mac OS (Silicon Valley Chips) Using PyCharm
Tags: python, pycharm, webdev, tutorial
Published: 2023-07-29 19:06:36

## **Introduction**
Odoo is a powerful and versatile open-source business application suite that includes a wide range of modules for various business needs, such as CRM, accounting, inventory, and more. If you’re a developer working on a Mac and prefer using PyCharm as your Integrated Development Environment (IDE), this guide will walk you through the process of installing Odoo on your Mac OS using PyCharm.

## **Prerequisites**

- Git — https://git-scm.com/downloads

- Python 3.7 or later (Preferably 3.8) — https://www.python.org/downloads/

- PyCharm IDE — https://www.jetbrains.com/pycharm/download/?section=mac

- PostgreSQL 10 or later (Preferably v13) — https://www.postgresql.org/download/

- PGAdmin 4 — https://www.pgadmin.org/

- Build Tools for Studio for Windows (I use MacOS in this tutorial) — https://visualstudio.microsoft.com/do...

- NodeJS — https://nodejs.org/en/download/

## **The Process**
Install Homebrew. Homebrew is a package manager for Mac that will make the installation process much smoother. Open your terminal and execute the following command to install Homebrew:

`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
 `

Install git using brew

`brew install git`

Install NodeJS

`npm install -g npm`

Install python, pycharm, postgreSQL, PGAdmin4 and visual studio by following the above link to continue the process below.

Using your preferred location, create the folder for your odoo community. Now let say you have a directory “/Users/username/Documents/odoo/v15/odoo-server”. Please note that username will be your Mac username. Open your terminal and go inside the above directory by using terminal. Clone the odoo v15 repository by following the the command below:

`git clone https://www.github.com/odoo/odoo --depth 1 --branch 15.0.`

It is advisable to use virtual environment so that python module packages will not mix with other Odoo instances or python versions. To create virtual environment, first go to “/Users/username/Documents/odoo/v15” in your terminal and run the following command:

`python3 -m venv odoo_venv`

After the above command, your v15 folder should be as follows:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xxnx6izky43bxxu1lnhm.jpeg)

Since we will be using pycharm, ensure that postgreSQL is running

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/byc10ey5jc9dmwzctqu3.png)

For security reason, we will not be able to use default postgres user. To create a new user, open pgAdmin 4. For first time use, it will ask for password.

Go to Servers - Localhost and right click Login/Group Roles and select Create - Login/Group Role…

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mwxpv7dnbdx8tw6uqjvz.png)

In General, type name and add password in definition. Lastly, under privileges, toggle Can Login and Create Databases. Click Save.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wip41ueaolz8ym6np28w.png)

Now, create a new folder under "Users/username/Documents/v15" and name it tutorial_theme. Open tutorial_theme with pycharm.

By default, PyCharm will create a new file main.py but delete it. Inside tutorial_theme folder, create Odoo configuration by creating a new file called odoo.conf. Add the following code to the odoo.conf file in pycharm:

```
[options]
admin_passwd = 1
db_host = False
db_port = False
db_user = trial
db_password = trail
dbfilter = ^tutorial_theme.*$
db_list = True
addons_path = /Users/username/Documents/odoo/v15/odoo-server/addons
http_port = 8069
```

Add virtual environment by going in PyCharm - Preferences - Project - Python Interpreter. Check the link of the current python interpreter you created under "Users/username/Documents/odoo/v15/odoo_venv, then click gear icon on the right side and click add to add it.

Select Existing Environment and locate python3 file which is located inside "odoo_venv/bin/python3". Click apply and okay button.

Edit the PyCharm configuration by clicking on the menu bar. By default, it creates a new configuration "main". Click main and click the minus (-) button on top left to delete it.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eyvt64rx41kehr13dtrg.png)

Click on the plus (+) button to add new and choose Python. Copy the code below for the script path and parameters. Please replace the code based on the location of your file. Click apply and OK.

```
Script Path: /Users/username/Documents/odoo/v15/odoo-server/odoo-bin 
Parameters: -c "/Users/username/Documents/odoo/v15/tutorial_theme/odoo.conf"
```

Run Odoo by clicking green arrow in the toolbar.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/782mcaiuxaib5v8asveg.png)

Go to the browser on type the url http://localhost:8069. You will be redirected to http://localhost:8069/web/database/manager since there are no database created.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bhikksx0m1vgry03qon4.png)

If you face the bug below:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2t3a8z4mkwtielqjybdm.png)

Undertake the following action to fix the problem:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lp69kpotm49wrtoshm7n.png)

Re-run odoo from pycharm and go back to the browser to type the url http://localhost:8069.

This should work perfectly!!!
You just installed odoo on MacBook silicon valley chip using pycharm!!!