Install Odoo with Pycharm Community Version in Mac
Hi again,
So few days after Christmas i plan to learn how to create Odoo module. I'm still really far from having deeper understanding with python actually, but that's okay.
So anyway, before we begin, you have to understand that Odoo ERP in general are running along with Postgresql as it's database. To create a development environment, we are going to use IDE (Which stands for Integrated Development Environment) named PyCharm.
What are we going to achieve in this blog tutorial :
- Installed git in your system. Most unix and mac (especially latest version) is preinstalled along with first OS installation.
- Installed PyCharm Community Edition IDE, which you can obtained from it's website here.
- Python 3, latest version would be better. Most mac machine has python 2.7, thus upgrading it to version 3 is better.
- Homebrew (Mac package manager)
-
First of all, you have to fork Odoo Community from it's official site on GitHub. You might want to refer to my other blog post on how to fork a github repository.
Odoo Community Repository on Github -
Click the green button, and copy the link.
Repository Link
-
Open and jump into your terminal, type in : .
git clone --branch branchname remote-repo-url
Therefore, the git command would be : -
While you wait, download Pycharm Community from it's official website.
Pycharm Website
- Later on, leave both process to complete. We move on to installing homebrew. Homebrew is a packages repository of mac and linux. Open a new tab of your terminal, and type in :
/bin/bash -c"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- After homebrew is finished installing, get yourself a postgresql database by typing :
brew install postgresql
- Wait until the process done, and then make sure that postgresql are installed by typing :
brew services start postgresql
- the command above is used if you want to start postgresql service on your mac. remember that running a postgresql will consume your mac resources, so when you feel like you don't need it you can stop the process by typing :
brew services stop postgresql
- Then, we need to enter into postgresql terminal-based database query by typing :
psql postgres
- Now, we are going to create a user that later connects odoo and postgresql. Since we are using odoo14, and as an example we will create a postgres user that has a name odoo14 and the password is also odoo14. So, the query will be :
CREATE USER odoo14 WITH PASSWORD 'odoo14';
- Then, give permission to it by typing
ALTER USER odoo14 WITH SUPEROLE; ALTER USER odoo14 WITH CREATEROLE; ALTER USER odoo14 WITH CREATEDB; ALTER ROLE odoo14 VALID UNTIL 'infinity';
- After that, open PyCharm terminal on the bottom tab of your screen, and type this command to run odoo
python3 odoo-bin --addons-path addons -r odoo14 -w odoo14
I bet you, an error would happen. hahaha. it's ok, it's just a python dependency that odoo needs to run, but it's not yet installed in your project directory. So the solution is quite simple, you just have to find a requirement.txt and double click it.
double click requirements.txt Then, on the right panel, right click and select install all packages
Install All Packages After it's done, try to run a command from step 18. Since i'm kind, i'm not gonna let you scroll up but copy-pasting the command here.
python3 odoo-bin --addons-path addons -r odoo14 -w odoo14
- If you still have an error, try to run and install the packages manually in terminal by typing
pip3 install <your-dependency-name>
To understand which dependency are missing, you have to check the error message that appears during installing requirement.txt. here's one of the example :
pip3 install docutils
The command above means installing docutils with python3.
If "pip3" cannot do any installation, try to use "pip" or "pip2". It's all based on which python you are installing during creating a project at first.From your computer browser, type in 0.0.0.0:8069 and you shall see this pops.
Odoo Succesfully Started
git clone --b 14.0 https://github.com/odoo/odoo.git
Congrats, Odoo development environment using Pycharm are successful. Now, you can try to make database on the web interface and doing your development.
Post a Comment for "Install Odoo with Pycharm Community Version in Mac"