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

Yes, all the sites I created are there, but when I try to access via the localhost (site name:8080) it does not work.

I also can’t seem to load the ERPNext into my site

Installing Frappé Apps onto Sites
$ bench --site <MY_SITE> install-app <MY_APP_NAME>

When I go:

$ bench --site teste2 install-app erpnext
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/env/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/commands/site.py”, line 160, in install_app
_install_app(app, verbose=context.verbose)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/installer.py”, line 109, in install_app
frappe.clear_cache()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/init.py”, line 512, in clear_cache
for fn in get_hooks(“clear_cache”):
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/init.py”, line 828, in get_hooks
hooks = _dict(cache().get_value(“app_hooks”, load_app_hooks))
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 72, in get_value
val = generator()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/init.py”, line 806, in load_app_hooks
for app in [app_name] if app_name else get_installed_apps(sort=True):
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/init.py”, line 770, in get_installed_apps
installed = json.loads(db.get_global(“installed_apps”) or “[]”)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 707, in get_global
return self.get_default(key, user)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 719, in get_default
d = self.get_defaults(key, parent)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 725, in get_defaults
defaults = frappe.defaults.get_defaults(parent)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/defaults.py”, line 57, in get_defaults
globald = get_defaults_for()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/defaults.py”, line 177, in get_defaults_for
where parent = %s order by creation""", (parent,), as_dict=1)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 121, in sql
self.connect()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 78, in connect
self.use(self.user)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 83, in use
self._conn.select_db(db_name)
_mysql_exceptions.OperationalError: (1049, “Unknown database ‘96a62ca98bdec7f5’”)

ok lets first remove them, for each one of them

bench drop-site sitename

then create a new site with providing full details
bench new-site SiteName --mariadb-root-username USERNAME --mariadb-root-password PASSWORD --verbose

Well… I’m not very lucky today…
For sites removal:

$ bench drop-site teste2

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 337, in drop_site
_drop_site(site, root_login, root_password, archived_sites_path, force)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/commands/site.py”, line 350, in drop_site
scheduled_backup(ignore_files=False, force=True)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 166, in scheduled_backup
odb = new_backup(older_than, ignore_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, force=force)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 176, in new_backup
odb.get_backup(older_than, ignore_files, force=force)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 48, in get_backup
self.set_backup_file_name()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 63, in set_backup_file_name
todays_date = now_datetime().strftime(’%Y%m%d
%H%M%S’)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/data.py”, line 122, in now_datetime
dt = convert_utc_to_user_timezone(datetime.datetime.utcnow())
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/data.py”, line 145, in convert_utc_to_user_timezone
return utcnow.astimezone(timezone(get_time_zone()))
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/data.py”, line 139, in get_time_zone
return frappe.cache().get_value(“time_zone”, _get_time_zone)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 72, in get_value
val = generator()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/data.py”, line 133, in _get_time_zone
return frappe.db.get_system_setting(‘time_zone’) or ‘Asia/Kolkata’
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 859, in get_system_setting
return frappe.cache().get_value(“system_settings”, _load_system_settings).get(key)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 72, in get_value
val = generator()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 858, in _load_system_settings
return self.get_singles_dict(“System Settings”)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 543, in get_singles_dict
tabSingles where doctype=%s""", doctype))
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 121, in sql
self.connect()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 78, in connect
self.use(self.user)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 83, in use
self._conn.select_db(db_name)
_mysql_exceptions.OperationalError: (1049, “Unknown database ‘96a62ca98bdec7f5’”)

For trying to create new site with full details:

$ bench new-site teste1 --mariadb-root-username USERNAME --mariadb-root-password PASSWORD --verbose

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 60, in create_database_and_user
if force or (db_name not in dbman.get_database_list()):
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 546, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 121, in sql
self.connect()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 78, in connect
self.use(self.user)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 83, in use
self._conn.select_db(db_name)
_mysql_exceptions.OperationalError: (1049, “Unknown database ‘USERNAME’”)

ok just delete the sites manually in the sites folder, and try to create a new one with
bench new-site SiteName
don’t install ERPNext, but after you create the site do
bench update

deleted sites manually, created new site with full detail and got the same message as above.
tried updating bench:

bench update

INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up to date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow)
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull upstream develop
From https://github.com/frappe/frappe

  • branch develop -> FETCH_HEAD
    Already up to date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    Updating Python libraries…
    INFO:bench.utils:./env/bin/pip install --upgrade pip
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    INFO:bench.utils:./env/bin/pip install -q -r /Users/Carvalho/src/frappe-bench/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
    Updating node libraries…
    INFO:bench.utils:npm install
    npm WARN frappe@ No description

up to date in 8.836s
Backing up 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/env/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/commands/site.py”, line 289, in backup
odb = scheduled_backup(ignore_files=not with_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, backup_path_private_files=backup_path_private_files, force=True)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 166, in scheduled_backup
odb = new_backup(older_than, ignore_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, force=force)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 176, in new_backup
odb.get_backup(older_than, ignore_files, force=force)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 48, in get_backup
self.set_backup_file_name()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 63, in set_backup_file_name
todays_date = now_datetime().strftime(’%Y%m%d
%H%M%S’)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/data.py”, line 122, in now_datetime
dt = convert_utc_to_user_timezone(datetime.datetime.utcnow())
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/data.py”, line 145, in convert_utc_to_user_timezone
return utcnow.astimezone(timezone(get_time_zone()))
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/data.py”, line 139, in get_time_zone
return frappe.cache().get_value(“time_zone”, _get_time_zone)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 72, in get_value
val = generator()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/data.py”, line 133, in _get_time_zone
return frappe.db.get_system_setting(‘time_zone’) or ‘Asia/Kolkata’
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 859, in get_system_setting
return frappe.cache().get_value(“system_settings”, _load_system_settings).get(key)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 72, in get_value
val = generator()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 858, in _load_system_settings
return self.get_singles_dict(“System Settings”)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 543, in get_singles_dict
tabSingles where doctype=%s""", doctype))
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 121, in sql
self.connect()
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 78, in connect
self.use(self.user)
File “/Users/Carvalho/frappe-bench/apps/frappe/frappe/database.py”, line 83, in use
self._conn.select_db(db_name)
_mysql_exceptions.OperationalError: (1049, “Unknown database ‘17f9b61099ac5e15’”)

if you do

bench mysql

then
show databases;

are there any databases created?

Well… unfortunately it seems that
“You’ve reached the maximum number of replies a new user can create on their first day. Please wait 19 hours before trying again.”

for my site (teste1)

$ bench mysql
Please specify --site sitename

for

$ bench mysql --site teste1
Error: no such option: --site

for

$ mysql
MariaDB [(none)]> show databases;
±-------------------+
| Database |
±-------------------+
| db |
| homebrew |
| information_schema |
| log |
| mysql |
| run |
| www |
±-------------------+
7 rows in set (0.01 sec)

well, i got somewhere different now:

================================================================================
Creation of your site - testerp.dev failed because MariaDB is not properly
configured to use the Barracuda storage engine.
Please add the settings below to MariaDB’s my.cnf, restart MariaDB then
run bench new-site testerp.dev again.

[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4

================================================================================

I’ve done a bit of research but couldn’t understand how to alter the file, any ideas?

EDIT:
found the file on /usr/loca/etc/my.cnf
added the lines before mentioned and it it seems to be ok.
downloaded ERPNext and Installed into my site (apparently without errors).

But now when I go to to my browser with: mysite:8000 I get a Failed to Open Page.

Any ideas on how to troubleshoot that?

Thanks again

EDIT2:

Really don’t know how, but it’s working now.
I made sure the 8000 port was open, changed the cfg files and now I’m able to connect via localhost:8000. Just don’t understand why I can’t use my site (URL) to connect, but well… the important thing is that it works.

Thanks a lot.

@lowercase00

Have you added your site to the hosts file?

Its in /etc/hosts

127.0.0.1	mysite.dev or
127.0.0.1	mysite
1 Like

didn’t know it existed!
thanks all working perfectly now!

I saw this bench installation went to python 3.5. it is mean the user have active python 3.5. at Nov 17 (2017) post … it was working. Is it correct erpnext working on python 3.5 ?