Skip to content

Instantly share code, notes, and snippets.

@rockavoldy
Last active March 21, 2024 15:20
Show Gist options
  • Save rockavoldy/b38b253b15b05f3ba5bd3aed54d82aa4 to your computer and use it in GitHub Desktop.
Save rockavoldy/b38b253b15b05f3ba5bd3aed54d82aa4 to your computer and use it in GitHub Desktop.
Install odoo on mac M1

Odoo 11 on Mac M1

Installation

Install pyenv first with pyenv-installer

# need to be forced because it conflict with jpeg-turbo
brew install jpeg && brew link jpeg --force
# same, need to be forced because it conflict with lzlib
brew install zlib && brew link zlib --force
# install postgresql and start the services, so it will run at login
brew install postgresql@12 && brew link postgresql@12 && brew services start postgresql@12
# install python3.7.13 with pyenv
pyenv install 3.7.13
# clone odoo11, and cd to the cloned repository
# .....
# create new virtualenv for odoo11
pyenv virtualenv 3.7.13 odoo11
# set the directory as odoo11, so when open this directory, will automatically use venv odoo11
pyenv local odoo11
# upgrade pip, and downgrade setuptools to v57.5 since 2to3 only exist until version 57.5
pip install --upgrade pip
pip install setuptools==57.5 wheel
pip install -r requirements.txt

Note

  1. Issue with psycopg2 failed to build, because postgresql is not yet installed, then can't find pg_config
    1. brew install postgresql@12 (or any postgresql version)
    2. brew link postgresql@12
    3. restart the terminal
    4. run pip install -r requirements.txt again
  2. Issue when install requirements.txt, failed when build cryptography and says "openssl/opensslv.h" file not found or psycopg and says ld: library not found for -lssl
    # install openssl@1.1
    export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix openssl@1.1)/lib/
    # try to install requirements.txt again
    pip install -r requirements.txt
  3. Issue when installing Pillow on the requirements.txt, error about missing zlib
    # Install zlib with homebrew
    brew install zlib
    # and link zlib with flag --force, need to be forced since it's conflict with lzlib
    brew link zlib --force
    # then run the install again

Odoo 15 on Mac M1

Installation

Install pyenv first with pyenv-installer

# need to be forced because it conflict with jpeg-turbo
brew install jpeg && brew link jpeg --force
# same, need to be forced because it conflict with lzlib
brew install zlib && brew link zlib --force
# install postgresql and start the services, so it will run at login
brew install postgresql@14 && brew link postgresql@14 && brew services start postgresql@14
# install python3.8.13 with pyenv
pyenv install 3.8.13
# clone odoo15, and cd to the cloned repository
# .....
# create new virtualenv for odoo15
pyenv virtualenv 3.8.13 odoo15
# set the directory as odoo15, so when open this directory, will automatically use venv odoo15
pyenv local odoo15
# upgrade pip, and downgrade setuptools to v57.5 since 2to3 only exist until version 57.5
pip install --upgrade pip
pip install setuptools==57.5 wheel --no-build-isolation
pip install -r requirements.txt --no-build-isolation
# then install odoo module so it will be exist as python module too
pip install -e .

Note

  1. Can't install gevent, because cython dropped cpdef on 3.0a8; gevent!1801
    1. Install Cython 3.0a7 pip install Cython==3.0a7
    2. pip install --ignore-requires-python --no-build-isolation gevent==20.12.1
    3. and install requirements.txt as usual with pip install -r requirements.txt --no-build-isolation
  2. Issue with psycopg2 failed to build, because postgresql is not yet installed, then can't find pg_config
    1. brew install postgresql@12 (or any postgresql version)
    2. brew link postgresql@12
    3. restart the terminal
    4. run pip install -r requirements.txt again
  3. Issue CRITICAL module lib has no attribute; odoo!99809 when run odoo
    1. pip install pyopenssl==22.0.0
  4. Issue when install requirements.txt, failed when build cryptography and says "openssl/opensslv.h" file not found
    1. make sure openssl@1.1 already installed (step 2)
    2. try to run again the installation with
      export LDFLAGS=-L$(brew --prefix openssl@1.1)/lib
      export CPPFLAGS=-I$(brew --prefix openssl@1.1)/include
      pip install -r requirements.txt
  5. Issue when install requirements.txt, failed to build reportlab, strcmp things
    1. export this CFLAGS and run again the installation
      export CFLAGS="-Wno-error=implicit-function-declaration"
      pip install -r requirements.txt
  6. Issue when installing Pillow on the requirements.txt, error about missing zlib
    # Install zlib with homebrew
    brew install zlib
    # and link zlib with flag --force, need to be forced since it's conflict with lzlib
    brew link zlib --force
    # then run the install again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment