I noticed a line in erpnext/__init __.py
from erpnext.__version__ import __version__
I added such line in my app which results into error:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, 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/revant/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
main()
File "/home/revant/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
click.Group(commands=commands)(prog_name='bench')
File "/home/revant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/home/revant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/home/revant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/revant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/revant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/revant/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/home/revant/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/revant/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File "/home/revant/frappe-bench/apps/frappe/frappe/commands.py", line 762, in console
frappe.init(site=site)
File "/home/revant/frappe-bench/apps/frappe/frappe/__init__.py", line 140, in init
setup_module_map()
File "/home/revant/frappe-bench/apps/frappe/frappe/__init__.py", line 741, in setup_module_map
for module in get_module_list(app):
File "/home/revant/frappe-bench/apps/frappe/frappe/__init__.py", line 641, in get_module_list
return get_file_items(os.path.join(os.path.dirname(get_module(app_name).__file__), "modules.txt"))
File "/home/revant/frappe-bench/apps/frappe/frappe/__init__.py", line 599, in get_module
return importlib.import_module(modulename)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/revant/frappe-bench/apps/civil_contracting/civil_contracting/__init__.py", line 1, in <module>
from civil_contracting.__version__ import __version__
ImportError: cannot import name __version__
Even bench console
doesn’t work because of this line. I commented the line in my app and tried following in bench console:
In [1]: from civil_contracting.__version__ import __version__
In [2]: __version__
Out[2]: u'1.3.0'