After all kind of bench command allways error: cannot import name is_root

Today I made a bench update:

Get this message:
"master branch is renamed to version-11 and develop to version-12. Please switch to new branches to get future updates.

To switch to version 11, run the following commands: bench switch-to-branch version-11"


Now ERPNext stuck with this:
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 587, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2800, in load_entry_point
return ep.load()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2431, in load
return self.resolve()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2437, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/home/frappe/.bench/bench/cli.py”, line 3, in
from bench.utils import is_root, PatchError, drop_privileges, get_env_cmd, get_cmd_output, get_frappe
ImportError: cannot import name is_root

Could someone help me out?
The system works, but can’t update.

Installed Apps

ERPNext: v11.1.47 (master)

Frappe Framework: v11.1.42 (master)

If I try:
bench --site site1.local backup --with-files

I got the same :
bench --site site1.local backup --with-files
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 587, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2800, in load_entry_point
return ep.load()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2431, in load
return self.resolve()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2437, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/home/frappe/.bench/bench/cli.py”, line 3, in
from bench.utils import is_root, PatchError, drop_privileges, get_env_cmd, get_cmd_output, get_frappe
ImportError: cannot import name is_root

if you are switched to python3-dev
before the
bench update command
then you have no issue.

If you are on python2.7

then after a
bench update command
you are stacked:

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 587, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2800, in load_entry_point
return ep.load()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2431, in load
return self.resolve()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2437, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/home/frappe/.bench/bench/cli.py”, line 3, in
from bench.utils import is_root, PatchError, drop_privileges, get_env_cmd, get_cmd_output, get_frappe
ImportError: cannot import name is_root

What to do?

A simple bench command cause this:

frappe@ubuntu:~/frappe-bench$ bench
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 587, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2800, in load_entry_point
return ep.load()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2431, in load
return self.resolve()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 2437, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/home/frappe/.bench/bench/cli.py”, line 3, in
from bench.utils import is_root, PatchError, drop_privileges, get_env_cmd, get_cmd_output, get_frappe
ImportError: cannot import name is_root

frappe@ubuntu:~/.bench$ git pull
error: object file .git/objects/08/59e5563637baec9c8caa466081ba283f7c64e4 is empty
error: object file .git/objects/08/59e5563637baec9c8caa466081ba283f7c64e4 is empty
fatal: loose object 0859e5563637baec9c8caa466081ba283f7c64e4 (stored in .git/objects/08/59e5563637baec9c8caa466081ba283f7c64e4) is corrupt
fatal: The remote end hung up unexpectedly
frappe@ubuntu:~/.bench$

Any help please.

/frappe & /erpnext git pull is works