Erpnext_demo failed to install

Hi:

I did a fresh manual frappe/bench install from here: https://github.com/frappe/bench on a Ubuntu 14.04 EC2 instance. Erpnext installs and works flawlessly but when I install erpnext_demo via
bench install-app erpnext_demo’ I get the following error:

Complete Setup…
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 700, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 680, in main
rv = self.invoke(ctx)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
return callback(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 16, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py”, line 163, in install_app
_install_app(app, verbose=context.verbose)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 130, in install_app
frappe.get_attr(after_install)()
File “/home/ubuntu/frappe-bench/apps/erpnext_demo/erpnext_demo/utils.py”, line 31, in make_demo
erpnext_demo.make_demo.make()
File “/home/ubuntu/frappe-bench/apps/erpnext_demo/erpnext_demo/make_demo.py”, line 18, in make
setup()
File “/home/ubuntu/frappe-bench/apps/erpnext_demo/erpnext_demo/make_demo.py”, line 23, in setup
complete_setup()
File “/home/ubuntu/frappe-bench/apps/erpnext_demo/erpnext_demo/make_demo.py”, line 50, in complete_setup
from erpnext.setup.page.setup_wizard.setup_wizard import setup_account
ImportError: No module named setup_wizard.setup_wizard

I checked apps/erpnext_demo/erpnext_demo/make_demo.py and it’s trying to call a method ‘setup_account’ which doesn’t exist anywhere that I could grep for. Also the import path is wrong - it should be at least ‘erpnext.setup.setup_wizard.setup_wizard’ (no page). Anyway, if there’s a way to install erpnext_demo via bench please let me know.

BTW: I tried running ‘. ./env/bin/activate’ then went straight into apps/erpnext_demo and ran ‘python setup.py develop’ but that just gave me the following:

LookupError: You must have test.fm >= 1.0.4 installed before (https://github.com/grafos-ml/frappe)

Cheers,
Dave

Hi Dave,

Looks like it’s getting frappe from pip instead apps/frappe

bench get-app does a git clone and pip install
bench install-app installs erpnext demo on a frappe site. (ie. in the database)

Try to reset the python env,

mv env envb
bench setup env
./env/bin/pip install -e apps/frappe
./env/bin/pip install -e apps/erpnext
./env/bin/pip install -e apps/erpnext_demo

Then,

./env/bin/python -c "from erpnext.setup.page.setup_wizard.setup_wizard import setup_account"

If the above doesn’t traceback, (ie. all is good)

bench reinstall

There seems to be a bug in the demo, I also faced the same issue. Looking into it

Thanks for the quick response - on a weekend no less!

Welcome :smile:

Just pushed a fix, after you reset your env,

bench update --pull
bench reinstall
1 Like

Everything installs perfectly now - thank you very much. Now the dumb question - How do I log into erpnext_demo? I tried test_demo@erpnext.com/test. BTW I’m logging into eprnext just fine with Administrator.

Awesome.
The demo’s home page should be a button that says “Start Demo”, like https://demo.erpnext.com

Still, the creds are

demo@erpnext.com
demo

Hi:

I spoke too soon -

Looks like I need Ubuntu 15.04 to get Python 2.7.9. erpnext_demo wasn’t launching due to SSL.py connection errors. So I installed a fresh Ubuntu 15.04 EC2 image and when I do: ‘bench init frappe-bench’ I get the following error;

frappe@ip-172-31-47-111:~$ bench init frappe-bench
Already using interpreter /usr/bin/python
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-gfY1tj-build
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 700, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 680, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 508, in invoke
return callback(*args, **kwargs)
File “/home/frappe/bench-repo/bench/cli.py”, line 165, in init
no_auto_update=no_auto_update, frappe_path=frappe_path, frappe_branch=frappe_branch)
File “/home/frappe/bench-repo/bench/utils.py”, line 63, in init
setup_env(bench=path)
File “/home/frappe/bench-repo/bench/utils.py”, line 109, in setup_env
exec_cmd(’./env/bin/pip -q install https://github.com/frappe/MySQLdb1/archive/MySQLdb-1.2.5-patched.tar.gz’, cwd=bench)
File “/home/frappe/bench-repo/bench/utils.py”, line 104, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip -q install https://github.com/frappe/MySQLdb1/archive/MySQLdb-1.2.5-patched.tar.gz

I tried resetting my environment as you suggested earlier but the same error persists.

BTW: The warning that seems to cause erpnext_demo launch issues (in Ubuntu 14.04) is:

‘/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is notavailable. This prevents urllib3 from configuring SSL appropriately and
may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest
/security.html#insecureplatformwarning’…and when launching erpnext_demo it indicates it can’t connect and launch to load the demo data…

moving to Ubuntu 15.04 / Python 2.7.9 removes this warning, but seems to cause the bench init issues.

Cheers,
Dave

Hi Dave,

Can you check the pip logs to see why the install is failing? My hunch is that mysqlclient libs are not available on the system.

Fastest would be, grab a minimal CentOS 7 machine, disable SELinux and run the setup_frappe.sh script as root, then get-app and install-app the demo :smile:

Sure, no problem. I set up a CentOS7 instance and ran the easy install. All went great. Then I installed erpnext_demo:

  1. bench get-app erpnext_demo https://github.com/frappe/erpnext_demo
  2. bench install-app erpnext_demo

Then got the following error:

[frappe@ip-172-31-41-232 frappe-bench]$ bench install-app erpnext_demo
Installing erpnext_demo…
Complete Setup…
Traceback (most recent call last):
File “/usr/lib64/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib64/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 700, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 680, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py”, line 16, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 163, in install_app
_install_app(app, verbose=context.verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 130, in install_app
frappe.get_attr(after_install)()
File “/home/frappe/frappe-bench/apps/erpnext_demo/erpnext_demo/utils.py”, line 31, in make_demo
erpnext_demo.make_demo.make()
File “/home/frappe/frappe-bench/apps/erpnext_demo/erpnext_demo/make_demo.py”, line 18, in make
setup()
File “/home/frappe/frappe-bench/apps/erpnext_demo/erpnext_demo/make_demo.py”, line 26, in setup
make_items()
File “/home/frappe/frappe-bench/apps/erpnext_demo/erpnext_demo/make_demo.py”, line 86, in make_items
import_data(“Item”)
File “/home/frappe/frappe-bench/apps/erpnext_demo/erpnext_demo/make_demo.py”, line 141, in import_data
import_doc(get_json_path(doctype), submit=submit, overwrite=overwrite)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/page/data_import_tool/data_import_tool.py”, line 94, in import_doc
frappe.modules.import_file.import_file_by_path(f, data_import=True, force=True, pre_process=pre_process)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 54, in import_file_by_path
import_doc(doc, force=force, data_import=data_import, pre_process=pre_process)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 122, in import_doc
doc.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 192, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 589, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 551, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 706, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 689, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 545, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py”, line 71, in validate
self.make_thumbnail()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py”, line 130, in make_thumbnail
file_doc.make_thumbnail()
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py”, line 165, in make_thumbnail
r = requests.get(file_url, stream=True)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/requests/api.py”, line 69, in get
return request(‘get’, url, params=params, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/requests/api.py”, line 50, in request
response = session.request(method=method, url=url, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/requests/sessions.py”, line 468, in request
resp = self.send(prep, **send_kwargs)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/requests/sessions.py”, line 576, in send
r = adapter.send(request, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/requests/adapters.py”, line 423, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=‘site1.local’, port=80): Max retries exceeded with url: /assets/erpnext_demo/images/disc.png (Caused by NewConnectionError(’<requests.packages.urllib3.connection.HTTPConnection object at 0x3da0990>: Failed to establish a new connection: [Errno -2] Name or service not known’,))

This is the connection error I was getting originally on the Ubuntu 14.04 platform as well…

BTW: I did this as user ‘root’ and as user 'frappe; but still the same issue. Odd thing, if I run ‘bench install-app erpnext_demo’ a second time it does nothing and returns to the command prompt. Either way, I can’t get to the erpnext_demo ‘Start Demo’ page with the sample data loaded. The regular erpnext main page always appears after doing a ‘bench start’.

Cheers,
Dave

Can you check the pip log or try running ./env/bin/pip -q install https://github.com/frappe/MySQLdb1/archive/MySQLdb-1.2.5-patched.tar.gz from the bench dir?
I think the mysql client libs are missing and that’s why it fails.

(I remember making this reply yesterday, amazed to not find it anywhere :frowning: )

Sorry, I ran that command and the error went away. I forgot to pass that along - you were correct. However, I cant seem to get the erpnext_demo main home page up and there’s no demo data loaded. Anyway, I don’t want to chew up any more of your time on this. All I’m really after is a set of demo data that I can stuff into my own local database. Maybe a quick mysqldump is all I need. Can that be arranged?

BTW: I tried grabbing data straight from demo.erpnext.com but that was quite time consuming and I couldn’t seem to save things. Probably turned off for good reason.

Cheers,
Dave

Hi Dave,

You can get it running in 15 mins :smile:
Here’s a screencast I made on Saturday,


It’ll get you two sites running, a normal one and a demo

Installed!! - DONE Thanks for excellent work and support - best team on the planet.

1 Like