Bench update --patch ModuleNotFoundError: No module named 'past then TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'

erpnext@ubuntu:~/erpnext/frappe-bench$ bench switch-to-branch version-11
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

INFO: Fetching upstream unshallow for frappe
$ git remote set-branches upstream  '*'
$ git fetch --all --unshallow --quiet
ERROR: Switching to version-11 will cause upgrade from 10 to 11. Pass --upgrade to confirm
erpnext@ubuntu:~/erpnext/frappe-bench$ bench switch-to-branch version-11 --upgrade
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

INFO: Fetching upstream unshallow for frappe
$ git remote set-branches upstream  '*'
$ git fetch --all --unshallow --quiet
Switching for frappe
$ git checkout -f version-11
Branch 'version-11' set up to track remote branch 'version-11' from 'upstream'.
Switched to a new branch 'version-11'
INFO: Fetching upstream unshallow for erpnext
$ git remote set-branches upstream  '*'
$ git fetch --all --unshallow --quiet
Switching for erpnext
$ git checkout -f version-11
Branch 'version-11' set up to track remote branch 'version-11' from 'upstream'.
Switched to a new branch 'version-11'
SUCCESS: Successfully switched branches for: frappe, erpnext
Please run `bench update --patch` to be safe from any differences in database schema
erpnext@ubuntu:~/erpnext/frappe-bench$ bench update --patch
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

Backing up sites...
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/erpnext/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 12, in <module>
    from past.builtins import cmp
ModuleNotFoundError: No module named 'past'
erpnext@ubuntu:~/erpnext/frappe-bench$ bench version
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/erpnext/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 12, in <module>
    from past.builtins import cmp
ModuleNotFoundError: No module named 'past'

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 33, in <module>
    sys.exit(load_entry_point('frappe-bench', 'console_scripts', 'bench')())
  File "/home/erpnext/erpnext/bench-repo/bench/cli.py", line 49, in cli
    if sys.argv[1] in get_frappe_commands() + ["--site", "--verbose", "--force", "--profile"]:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'

any suggestion please?

Hello @justmejust, did you fix this error? I’m asking because I’m with this error as well