Error when migrating v12 to python 3.7

Hey guys,
So I have tried to migrate the current erpnext from python 2.7 to python3.7

Traceback is as this:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/", line 2327, in <module>
  File "/usr/local/lib/python2.7/dist-packages/", line 711, in main
  File "/usr/local/lib/python2.7/dist-packages/", line 944, in create_environment
  File "/usr/local/lib/python2.7/dist-packages/", line 900, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/usr/local/lib/python2.7/dist-packages/", line 795, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/frappe/frappe-bench/env/bin/python3.7 - setuptools pip wheel failed with error code 1
DEBUG:bench.commands:Migration Error
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-repo/bench/", line 40, in cli
  File "/usr/local/lib/python2.7/dist-packages/click/", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/bench-repo/bench/commands/", line 159, in migrate_env
    ), cwd = path)
  File "/home/frappe/bench-repo/bench/", line 161, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: /usr/local/bin/virtualenv --python /usr/local/bin/python3.7 /home/frappe/frappe-bench/env

Does anyone have any idea on how this can be fixed to move forward with the migration ?

I am also happy to give this job to someone who is willing to get it :slight_smile:

Hello @Iulian_Olaru

These are the steps to do so :

sudo apt-get install python3-dev
bench migrate-env python3
bench restart
bench update 

Kalpit Shah

Yep, but it doesn’t work :slight_smile:

Every time I try there’s always a different error :slight_smile: