Import Error:cannot import name regional_overrides

while trying switching to development from production at the bench start step i got the error like
import error:Cannot import name regional_overrides
Help me with this…

Run bench update again.

after some issues it got resolved but there errors for import eroor:pyotp and os
and when i tried to update it is showing like


I have tried with bench update -reset
but at a point it is showing error something like command for fetch -all doesn’t work like that

Share your trace for bench update --reset

Please copy paste your full trace, don’t attach an image.

1 Like

well i tried with my github account which i pushed the code from another server
error: Could not fetch origin

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/ubuntu/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/.bench/bench/commands/update.py", line 62, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force, reset=reset)
  File "/home/ubuntu/.bench/bench/commands/update.py", line 79, in _update
    pull_all_apps(bench_path=bench_path, reset=reset)
  File "/home/ubuntu/.bench/bench/app.py", line 165, in pull_all_apps
    exec_cmd("git fetch --all", cwd=app_dir)
  File "/home/ubuntu/.bench/bench/utils.py", line 140, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git fetch --all

Clearly it is not able to pull code or update.

Sry to trouble you
When i run the bench start command it is showing…

And i changed it to production mode to development…and after i run the command bench start and the error i am getting is

2710:M 11 Aug 11:17:47.912 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
11:17:47 redis_queue.1    | 2710:M 11 Aug 11:17:47.912 * The server is now ready to accept connections on port 11000
11:17:49 socketio.1       | listening on *: 9000
11:17:52 worker_long.1    | 11:17:52 RQ worker u'rq:worker:ip-172-31-9-228.2699.long' started, version 0.8.0
11:17:52 worker_long.1    | 11:17:52 Cleaning registries for queue: long
11:17:52 worker_short.1   | 11:17:52 RQ worker u'rq:worker:ip-172-31-9-228.2713.short' started, version 0.8.0
11:17:52 worker_long.1    | 11:17:52 
11:17:52 worker_long.1    | 11:17:52 *** Listening on long...
11:17:52 worker_short.1   | 11:17:52 Cleaning registries for queue: short
11:17:52 worker_short.1   | 11:17:52 
11:17:52 web.1            | Traceback (most recent call last):
11:17:52 worker_short.1   | 11:17:52 *** Listening on short...
11:17:52 web.1            |   File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
11:17:52 web.1            |     "__main__", fname, loader, pkg_name)
11:17:52 web.1            |   File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
11:17:52 web.1            |     exec code in run_globals
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
11:17:52 web.1            |     main()
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
11:17:52 web.1            |     click.Group(commands=commands)(prog_name='bench')
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
11:17:52 web.1            |     return self.main(*args, **kwargs)
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
11:17:52 web.1            |     rv = self.invoke(ctx)
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
11:17:52 web.1            |     return _process_result(sub_ctx.command.invoke(sub_ctx))
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
11:17:52 web.1            |     return _process_result(sub_ctx.command.invoke(sub_ctx))
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
11:17:52 web.1            |     return ctx.invoke(self.callback, **ctx.params)
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
11:17:52 web.1            |     return callback(*args, **kwargs)
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
11:17:52 web.1            |     return f(get_current_context(), *args, **kwargs)
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
11:17:52 web.1            |     ret = f(frappe._dict(ctx.obj), *args, **kwargs)
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/utils.py", line 353, in serve
11:17:52 web.1            |     import frappe.app
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py", line 19, in <module>
11:17:52 web.1            |     import frappe.auth
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/apps/frappe/frappe/auth.py", line 20, in <module>
11:17:52 web.1            |     from frappe.twofactor import (should_run_2fa, authenticate_for_2factor,
11:17:52 web.1            |   File "/home/ubuntu/frappe-bench/apps/frappe/frappe/twofactor.py", line 8, in <module>
11:17:52 web.1            |     import pyotp, os
11:17:52 web.1            | ImportError: No module named pyotp
11:17:52 worker_default.1 | 11:17:52 RQ worker u'rq:worker:ip-172-31-9-228.2701.default' started, version 0.8.0
11:17:52 worker_default.1 | 11:17:52 Cleaning registries for queue: default
11:17:52 worker_default.1 | 11:17:52 
11:17:52 worker_default.1 | 11:17:52 *** Listening on default...
11:17:52 system           | web.1 stopped (rc=1)
11:17:52 system           | sending SIGTERM to redis_socketio.1 (pid 2690)
11:17:52 system           | sending SIGTERM to worker_long.1 (pid 2686)
11:17:52 system           | sending SIGTERM to watch.1 (pid 2685)
11:17:52 system           | sending SIGTERM to redis_queue.1 (pid 2696)
11:17:52 system           | sending SIGTERM to schedule.1 (pid 2693)
11:17:52 system           | sending SIGTERM to worker_default.1 (pid 2691)
11:17:52 system           | sending SIGTERM to socketio.1 (pid 2698)
11:17:52 system           | sending SIGTERM to redis_cache.1 (pid 2694)
11:17:52 system           | sending SIGTERM to worker_short.1 (pid 2695)
11:17:52 redis_socketio.1 | 2704:signal-handler (1502450272) Received SIGTERM scheduling shutdown...
11:17:52 worker_long.1    | 11:17:52 Warm shut down requested
11:17:52 redis_queue.1    | 2710:signal-handler (1502450272) Received SIGTERM scheduling shutdown...
11:17:52 worker_default.1 | 11:17:52 Warm shut down requested
11:17:52 system           | socketio.1 stopped (rc=-15)
11:17:52 redis_cache.1    | 2712:signal-handler (1502450272) Received SIGTERM scheduling shutdown...
11:17:52 worker_short.1   | 11:17:52 Warm shut down requested
11:17:52 system           | schedule.1 stopped (rc=-15)
11:17:52 system           | watch.1 stopped (rc=-15)
11:17:52 redis_socketio.1 | 2704:M 11 Aug 11:17:52.893 # User requested shutdown...
11:17:52 redis_socketio.1 | 2704:M 11 Aug 11:17:52.893 # Redis is now ready to exit, bye bye...
11:17:52 system           | redis_socketio.1 stopped (rc=-15)
11:17:52 redis_queue.1    | 2710:M 11 Aug 11:17:52.915 # User requested shutdown...
11:17:52 redis_queue.1    | 2710:M 11 Aug 11:17:52.915 # Redis is now ready to exit, bye bye...
11:17:52 system           | redis_queue.1 stopped (rc=-15)
11:17:52 system           | worker_short.1 stopped (rc=-15)
11:17:52 system           | worker_default.1 stopped (rc=-15)
11:17:52 system           | worker_long.1 stopped (rc=-15)
11:17:52 redis_cache.1    | 2712:M 11 Aug 11:17:52.924 # User requested shutdown...
11:17:52 redis_cache.1    | 2712:M 11 Aug 11:17:52.924 # Redis is now ready to exit, bye bye...
11:17:52 system           | redis_cache.1 stopped (rc=-15)
# pyotp module is missing, lets install it
cd ~/frappe-bench # or your bench path
bench update --requirements
# OR
./env/bin/pip install --upgrade pyotp
# then try
bench start
1 Like