Bench update not working after bench migrate-env python3.6 (OSError: [Errno 2] No such file or directory)

Bench commands not working properly since I have used this command bench migrate-env python3.6

not even bench update is working properly.

/home/frappe/frappe-bench# bench update
Backing up sites...
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/", line 41, in cli
  File "/usr/local/lib/python2.7/dist-packages/click/", line 764, in __call__
return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 717, in main
rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 555, in invoke
return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/", line 25, in update
update(pull=pull, patch=patch, build=build, requirements=requirements, restart_supervisor=restart_supervisor, restart_systemd=restart_systemd, backup=not no_backup, force=force, reset=reset)
  File "/home/frappe/.bench/bench/", line 193, in update
  File "/home/frappe/.bench/bench/", line 656, in backup_all_sites
backup_site(site, bench_path=bench_path)
  File "/home/frappe/.bench/bench/", line 651, in backup_site
run_frappe_cmd('--site', site, 'backup', bench_path=bench_path)
  File "/home/frappe/.bench/bench/", line 769, in run_frappe_cmd
cwd=sites_dir, stdout=stdout, stderr=stderr)
  File "/usr/lib/python2.7/", line 711, in __init__
errread, errwrite)
  File "/usr/lib/python2.7/", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

Does bench console work?

If so , what does print (sys.version) report?

/home/frappe/frappe-bench# bench console
Usage: bench [OPTIONS] COMMAND [ARGS]...
Try "bench --help" for help.

Error: No such command "console".

Does bench show-config return anything?

/home/frappe/frappe-bench# bench show-config
Usage: bench [OPTIONS] COMMAND [ARGS]...
Try "bench --help" for help.

Error: No such command "show-config".

What does python3 -V return?

python3 -V
Python 3.5.2

The OP said this was used:

However your version is 3.5,2.

Try bench migrate-env python3.5.2 or see if you can install python 3.6 .

What is the host environment, OS etc?

OS: Ubuntu 16.06, 2GB, 2 Cores.

Try bench migrate-env python3.5.2 then bench update --reset

I had problems using Ubuntu 16. The stable version for ERPNext is Ubuntu 18

@Joseph_Marie_Alba1 How did you successfully migrate ERPnext to Ubuntu 18?

Did you created a new instance and moved the db on it or what ?

Yes. backup the database using bench backup (search this forum)
then, restore to the new setup using bench restore (search this forum)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.