[SOLVED] Install ERPNext on OS X (w/o VM)

Hey everyone.

I manage to install ERPNext using the .ova file and VirtualBox.

As I also use Win7 with Parallels (running on my macOS Sierra), I was wondering if there is anyway to run ERPNext directly on my Mac (without needing a VM) - my Macbook gets a bit slow when I run the macOS + 2 Virtual Machines in it.

I’ve tried frappe/bench instructions on GitHub, but I’m having a hard time understanding how it works and if it would help me installing ERPNext.

Any suggestions, ideas, articles, or anything that could help?

Thanks a lot.

EDIT:

By the way, I get stuck in creating a new bench with command line (in terminal): “bench init frappe-bench && cd frappe-bench”. It gives me a syntax error…

check out this complete guide https://github.com/frappe/frappe/wiki/The-Hitchhiker%27s-Guide-to-Installing-Frappé-on-Mac-OS-X

Thanks a lot for you response.

I’ve installed Homebrew, Python, MariaDB, Redis, Node and Git.

When I try to install Bench (by:

…and install Bench using pip
$ pip install -e git+https://github.com/frappe/bench#egg=frappe-bench

I get the following message on Terminal:

Obtaining frappe-bench from git+https://github.com/frappe/bench#egg=frappe-bench
Updating ./src/frappe-bench clone
Running setup.py (path:/Users/Carvalho/src/frappe-bench/setup.py) egg_info for package frappe-bench produced metadata for project name bench. Fix your #egg=frappe-bench fragments.
Requirement already satisfied: Click in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from bench)
Requirement already satisfied: jinja2 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from bench)
Requirement already satisfied: virtualenv in ./Library/Python/3.5/lib/python/site-packages (from bench)
Requirement already satisfied: requests in ./Library/Python/3.5/lib/python/site-packages (from bench)
Requirement already satisfied: honcho in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from bench)
Requirement already satisfied: psutil in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from bench)
Requirement already satisfied: python-crontab in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from bench)
Requirement already satisfied: semantic_version in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from bench)
Requirement already satisfied: GitPython==0.3.2.rc1 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from bench)
Requirement already satisfied: MarkupSafe in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from jinja2->bench)
Requirement already satisfied: idna<2.7,>=2.5 in ./Library/Python/3.5/lib/python/site-packages (from requests->bench)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./Library/Python/3.5/lib/python/site-packages (from requests->bench)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in ./Library/Python/3.5/lib/python/site-packages (from requests->bench)
Requirement already satisfied: certifi>=2017.4.17 in ./Library/Python/3.5/lib/python/site-packages (from requests->bench)
Requirement already satisfied: python-dateutil in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from python-crontab->bench)
Requirement already satisfied: gitdb>=0.5.1 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from GitPython==0.3.2.rc1->bench)
Requirement already satisfied: six>=1.5 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from python-dateutil->python-crontab->bench)
Requirement already satisfied: smmap>=0.8.5 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from gitdb>=0.5.1->GitPython==0.3.2.rc1->bench)
Installing collected packages: bench
Found existing installation: bench 4.1.0
Exception:
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/commands/install.py”, line 342, in run
prefix=options.prefix_path,
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/req/req_set.py”, line 778, in install
requirement.uninstall(auto_confirm=True)
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/req/req_install.py”, line 703, in uninstall
‘(at %s)’ % (link_pointer, self.name, dist.location)
AssertionError: Egg-link /Users/Carvalho/src/frappe-bench does not match installed location of bench (at /Users/Carvalho/bench-repo)

And when I run $ bench --version I get:

-bash: /Library/Frameworks/Python.framework/Versions/3.5/bin/bench: No such file or directory

Very confused…

make sure you are using latest Python 2.7.

do
python --version

On terminal:

$ python --version
Python 2.7.10

update python using brew. the one you are using is old which is the one shipped with mac

Thanks.

I tried

$ brew upgrade python
python 2.7.14 already installed

But when I go

$ python --version
Python 2.7.10

$ python2 --version
Python 2.7.14

I’ve read on Stackoverflow that I should change the $PATH to the new python, but i just can’t find the Cellar folder that brew is supposed to use…

brew unlink python && brew link python

Thanks a lot. I think the installation worked:

$ bench --version
4.1.0

But now I get an error while creating a site:

_mysql_exceptions.ProgrammingError: (1146, “Table ‘mysql.user’ doesn’t exist”)

Tried uninstalling MariaDB and MySQL and installing both again, but didn’t work.

Welcome, lowercase00:

I recently got ERPNext 9.x.x installed on my macbook pro running OSX 10.13 (High Sierra). It took me several days of eliminating/resolving a series of configuration issues including multiple python versions, multiple pip versions, outdated homebrew versions, anaconda-related conflicts, bash $PATH definitions, and mariadb/mysql database incompatibilities.

I initially has mysql running on my macbook. I uninstalled mysql and installed mariadb. That still had issues.

My old /usr/local/var/mysql/lib directory was the issue. This is the directory that holds your old mysql databases among other configuration items. As it turns out the lib directory is not affected by brew uninstall mysql or brew uninstall mariadb actions.

These issues were resolved when I moved the entire /usr/local/var/mysql/lib directory to /usr/local/var/mysql/lib.orig . Then I brew uninstall mariadb and then brew install mariadb. It created a fresh, new, clean /usr/local/var/mysql/lib directory which was compatible with ERPNext.

You don’t need to have mysql installed. Good Luck

@rwp, thanks for the input.

Strange, I don’t even have that folder (/usr/local/var/mysql/lib)…

I’ll keep trying, thanks anyway.

You are in Configuration Hell. It took me several days to overcome this situation.

Different installers place distributions in different places.
If you have the ‘locate’ service working on your mac, try:

$ locate mysql | grep mysql/lib

Locate result:

WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

Tried loading it with the command provided above and got:

/System/Library/LaunchDaemons/com.apple.locate.plist: service already loaded
Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.

My most recent error while trying to create a site, if anyone is familiar with it:
(the funny thing is that the site is created on Users/MyUser/MYBENCH/Sites)

Traceback (most recent call last):
File “/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/Users/Carvalho/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/Users/Carvalho/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/Users/Carvalho/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Users/Carvalho/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Users/Carvalho/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/Users/Carvalho/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/commands/site.py”, line 29, in new_site
verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/commands/site.py”, line 60, in _new_site
admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/installer.py”, line 36, in install_db
create_database_and_user(force, verbose)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/installer.py”, line 61, in create_database_and_user
dbman.delete_user(db_name)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 509, in delete_user
self.db.sql(“DROP USER ‘%s’@‘%s’;” % (target, host))
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 163, in sql
self._cursor.execute(query)
File “/Users/Carvalho/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 250, in execute
self.errorhandler(self, exc, value)
File “/Users/Carvalho/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/connections.py”, line 50, in defaulterrorhandler
raise errorvalue
_mysql_exceptions.ProgrammingError: (1146, “Table ‘mysql.user’ doesn’t exist”)

Configuration hell indeed…

if you can find the mysql/lib directory and move it, the clean install of
$ brew install mariadb
will create a new mysql database which should be properly configured.

are you able to do
bench mysql

15:25 $ bench mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 7419
Server version: 10.2.9-MariaDB Homebrew

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [e38492a82d3d42e0]>

$ bench mysql

Please specify --site sitename

$ mysql

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 121
Server version: 10.2.10-MariaDB Homebrew

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

EDIT:
Error on the Python Honcho Start tab of terminal:

OperationalError: (1049, “Unknown database ‘96a62ca98bdec7f5’”)

I don’t fully understand the mysql/python binding issues but it appears that

Mysql-python (1.2.5) and mysqlclient are alternatives. I currently have Mysql-python installed and do not have mysqlclient installed

in your sites folder is there any site?

bench is directory-dependent …

In my home directory:
15:32 $ cd
:heavy_check_mark: ~
15:32 $ bench mysql
Usage: bench [OPTIONS] COMMAND [ARGS]…

Error: No such command “mysql”.
✘-2 ~

While in my frappe-bench directory
15:32 $ cd ERPNext/frappe-bench/
:heavy_check_mark: ~/ERPNext/frappe-bench
15:32 $ bench mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 7420
Server version: 10.2.9-MariaDB Homebrew

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [e38492a82d3d42e0]>

EDIT:
regarding honcho:
I had too many honcho’s installed, one by pip, one by brew

Summary:
I had too many pythons installed, too many pip’s installed, too many honcho’s installed, too many databases installed, too many database bindings installed, etc

I simplified everything by uninstalling anaconda and ALL the multiple installations of python, pip, honcho, db, db-bindings, etc and then did clean installs of everything.

ERPNext installation is VERY FINICKY and VERY unforgiving.

1 Like