Installing Frappe/ERPNext (develop branch) on MacOS (Apple Silicon) for Development

I have been searching for this guide for an extended period, attempting multiple times, yet encountering difficulties specifically with MariaDB.

@rmeyer any update?

I added “1.6 Allow homebrew for the non-admin user (optional)”. That (followed by reinstalling mariadb and my frappe sites) did the trick.

One last problem remains: MariaDB doesn’t automatically start on login. We need to run brew services start mariadb@10.6 once after logging into the notebook.

The GitHub CLI is also very useful for contributing to frappe (apps).

Install:

brew install gh

Enable auto completion in zsh (optional, there are similar commands for other shells):

gh completion -s zsh > /opt/homebrew/share/zsh-completions/_gh

Try mariadb 10.8. First remove all other versions of mariadb.

brew install mariadb@10.8

I have used Macports successfully. Only issue is that any major OS upgrade will require reinstallation

At a second try, I had trouble with MariaDB as well. I think one issue was that I installed MariaDB as admin user, then tried to use it as non-admin, resulting in wrong default-permissions. I adjusted the order/user for the commands above so that it should work better now.

I want an environment where I can start all the services when I need to develop something. So that my performance and battery doesn’t suffer when I don’t do development.

How can I do that with this install?

The only thing running in the background is MariaDB. I think it doesn’t drain your battery, it just occupies some of your RAM. You can start/stop it with brew services start mariadb@10.6 / brew services stop mariadb@10.6.

All the other services, you start with bench start and stop with control + c.

It should also be possible to not install MariaDB as a service in the first place. Instead, you always start it explicitly by adding an entry to your Procfile. But you’ll need to figure this out yourself.

1 Like

Thank you @rmeyer

On my latest try, I encountered an error when starting honcho: ModuleNotFoundError: No module named pkg_resources

I was able to resolve this by installing setuptools in the same python virtual environment as honcho:

/Users/$USER/.local/pipx/venvs/hocho/bin/python3 -m pip install -U setuptools

Also, for newly created benches, the section 4.1 Silence errors caused by RQ on Mac is no longer required, since it has been incorporated into the bench’s Procfile.

@rmeyer

I am using the macbook os sonoma v14.5, if I restart the system means the mariadb service goes off and try to start it using the command “brew services start mariadb” means getting an error like this Bootstrap failed: 5: Input/output error Try re-running the command as root for richer errors. Error: Failure while executing; /bin/launchctl bootstrap gui/502 /Users/albertmontolio/Library/LaunchAgents/homebrew.mxcl.mariadb.plist exited with 5. so how to solve this?

I don’t get this error

Did you specify the MariaDB version in your start command?

brew services start mariadb@10.6

@rmeyer
Bootstrap failed: 5: Input/output error this is what I also get

➜ ~ sudo /opt/homebrew/opt/mariadb@10.6/bin/mysqladmin -u root password $NEW_PASSWORD

/opt/homebrew/opt/mariadb@10.6/bin/mysqladmin: connect to server at ‘localhost’ failed
error: ‘Can’t connect to local server through socket ‘/tmp/mysql.sock’ (2)’
Check that mariadbd is running and that the socket: ‘/tmp/mysql.sock’ exists!
➜ ~

Hello @rmeyer Thanks for sharing the detailed steps.
I am on macbook pro Sonoma 14.4.1 (M1 max chip).

I was able to execute all the steps, bench was started successfully but I am not able to access erpnext portal on http://127.0.0.1:8000/

image

In the bench logs I see a 404:
16:15:45 web.1 | 127.0.0.1 - - [15/Sep/2024 16:15:45] "GET / HTTP/1.1" 404 -

Also when I was installing erpnext app using bench get-app erpnext I got an error message in console:
$ /Users/yusuf/Documents/Frappe/bench0/env/bin/python -m pip install --quiet --upgrade -e /Users/yusuf/Documents/Frappe/bench0/apps/erpnext ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. frappe 16.0.0.dev0 requires pycountry~=24.6.1, but you have pycountry 22.3.5 which is incompatible.

but the app was installed DONE Total Build Time: 428.874ms

Any suggestions pls?

1 Like

So I added my site erp.local to hosts using following bench command:
bench --site erp.local add-to-hosts

After this I was able to launch portal at http://erp.local:8000!

However 127.0.0.1:8000 still does not work. Is this normal?

1 Like

Thanks for this great manual!
I had the same error (M1, macOS Sequoia 15.0) when bench start, but I couldn’t install setuptools the way you described. Instead, I had to use the virtual environment

python3 -m venv path/to/venv
source path/to/venv/bin/activate
python3 -m pip install python-setuptools

After installing, I was able to start the bench.

hello good day, when i check run brew services list I get this: “mariadb@10.6 error 256 davearktechk ~/Library/LaunchAgents/homebrew.mxcl.mariadb@10.6.plist” and despite having access to MySQL root I get this error: “b”--------------\nDROP TABLE IF EXISTS tabDocField\n--------------\n\nERROR 1036 (HY000) at line 9: Table ‘tabdocfield’ is read only\n"". when I run bench new-site library.localhost

my setup
MariaDB is 10.6
Python 3.12.8
bench 5.23.0
node 18
OS 15.2 sequoia
frappe 15.x.x-develop

same issue