Mac 10.13.2 Configuring the ODOO9 environment

Source: Internet
Author: User
Tags install homebrew postgresql virtual environment virtualenv git clone

Related Reference documents:

1. Chinese-English control, Zhuo Yi finishing simple translation and verification: install Odoo in MacOS and configure the Odoo development environment

Installing the Odoo 11.0 development environment on 2.MAC OS X 10.13

Body One: Install homebrew
    • With homebrew We can install the installation package in the terminal as in Linux.
    • Type the following command in the MacOS Terminal (Terminal) (Note that # is not included)
"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"# 此地址不稳定,多试几次即可
Two: Install Python
    • The Mac system comes with a python environment, but after I test it doesn't start odoo properly (maybe I'm not in the right position), you can uninstall your own Python and reinstall it with brew
brew updatebrew install python
Three: Installing PostgreSQL using homebrew
brew install postgresql
    • Choose to start as a service here
start | stop postgresql #做为服务启动postgresqlpg_ctl -D /usr/local/var/postgres start #不作为服务启动
    • Accessing the default database
psql postgresql
IV: The dependencies required to install the pillow
brew install freetype jpeg libpng libtiff webp xz
V: Install virtualenv (this is optional installation, not installed can also start)
    • The virtual environment is a separate Python workspace. Useful for developers, you can use a Python library that doesn't have a version in a different virtual environment. You can create multiple environments on demand using the Virtualent path/to/newenv command. This creates the Newenv directory to the specified path, including bin/and lib/python2.7/These subdirectories we use PIP, the Python Package Manager, to install the Python dependency required by Odoo, and the PIP will be installed with the previous python. In order to create a virtual environment, we need to install virtualenv. Homebrew does not contain virtualenv, so we install it via PIP:
# 安装pipsudo pip install virtualenv 安装virtualenv
    • Now we can create a virtual environment where we use the Odoo-env directory
virtualenv ~/odoo-env  #这会在 当前 目录 创建 odoo-env 目录,这个目录内 包含了<span style="font-weight: 400;">bin/ 和 lib/python2.7/ 这些子目录</span>
    • Enter the virtual environment you just created
source ~/odoo-env/bin/activate
    • See if you are in a virtual environment
which pythondeactivate # 离开虚拟环境
Six: Download Odoo and install the dependencies required by Odoo
    • Download odoo9 (via git clone)
clone https://github.com/odoo/odoo.git -b 9.0 --depth=1
    • Then go into the Odoo directory to install the Python dependencies required by Odoo
# 若没有安装pippip install -r requirements.txt # 根据odoo目录中requirements.txt进行安装(这步需要在上面安装好的虚拟环境中执行,我在虚拟环境外安装时报错)
    • Installing Nodejs
node #同样在虚拟环境中执行(外面没试过)
    • Installing less and LESS-PLUGIN-CLEAN-CSS
install -g less less-plugin-clean-css #同样在虚拟环境中执行(外面没试过)
Seven: Run Odoo
./odoo.py # 虚拟环境中
Eight: Odoo configuration file
    • There is no configuration file in the Odoo9 directory that is obtained from git and may be typed in ~/.openerp_server.conf if it cannot be found.
./odoo.py -s # 生成配置文件~/.openerp_serverrc.conf (odoo11则会生成~/.odoorc.conf)cp ~/.openerp_serverrc.conf ~/odoo/openerp_server.conf #拷贝到odoo目录下即可
Nine: Pycharm configuration Odoo
    • Pycharm directly open the downloaded Odoo directory
    • Edit configuration is consistent with Windows, run scripts remember to write Python in the virtual environment created above

Mac 10.13.2 Configuring the ODOO9 environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.