Error upgrading the python version

Already up to date.
INFO:bench.utils:Bench Updated!
INFO:bench.utils:./env/bin/pip install Pillow
/bin/sh: 1: ./env/bin/pip: not found
Please install these dependencies using the command:
sudo apt-get install -y libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk
Traceback (most recent call last):
File “/home/erpnext/.local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/opt/erpnext/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/erpnext/bench-repo/bench/commands/update.py”, line 68, in update
_update(pull, patch, build, bench, auto, restart_supervisor, restart_systemd, requirements, no_backup, force=force, reset=reset)
File “/opt/erpnext/bench-repo/bench/commands/update.py”, line 78, in _update
before_update(bench_path=bench_path, requirements=requirements)
File “/opt/erpnext/bench-repo/bench/utils.py”, line 792, in before_update
validate_pillow_dependencies(bench_path, requirements)
File “/opt/erpnext/bench-repo/bench/utils.py”, line 800, in validate_pillow_dependencies
exec_cmd(“{pip} install Pillow”.format(pip=pip))
File “/opt/erpnext/bench-repo/bench/utils.py”, line 173, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install Pillow

I get this when I try to updgrade the env

bench migrate-env python3
DEBUG:bench.commands:Clearing Redis Cache…
INFO:bench.utils:/usr/local/bin/redis-cli -p 13000 FLUSHALL
OK
DEBUG:bench.commands:Clearing Redis DataBase…
INFO:bench.utils:/usr/local/bin/redis-cli -p 13000 FLUSHDB
OK
DEBUG:bench.commands:Backing up Virtual Environment
DEBUG:bench.commands:Migration Error
Traceback (most recent call last):
File “/home/erpnext/.local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/opt/erpnext/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/erpnext/bench-repo/bench/commands/init.py”, line 142, in migrate_env
os.rename(source, dest)
OSError: [Errno 2] No such file or directory

bench migrate-env python3.7
DEBUG:bench.commands:Clearing Redis Cache…
INFO:bench.utils:/usr/local/bin/redis-cli -p 13000 FLUSHALL
OK
DEBUG:bench.commands:Clearing Redis DataBase…
INFO:bench.utils:/usr/local/bin/redis-cli -p 13000 FLUSHDB
OK
DEBUG:bench.commands:Backing up Virtual Environment
DEBUG:bench.commands:Migration Error
Traceback (most recent call last):
File “/home/erpnext/.local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/opt/erpnext/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/erpnext/bench-repo/bench/commands/init.py”, line 142, in migrate_env
os.rename(source, dest)
OSError: [Errno 2] No such file or directory

From my experience this is suspect, the path to your bench is not correct - the problem may be with your install? bench.utils.CommandFailedError: npm install - #40 by clarkej

Another suggestion - with your listings, include the command prompt, so your audience will know the user account for example ‘frappe’ and the directory you run a command from for example ‘frappe-bench’

frappe@ubuntu1804lts:~/frappe-bench$ which bench
/home/frappe/.local/bin/bench

Also perhaps point to the ‘official’ install notes you used to perform the install.

Here is my command prompt result -

I followed many forum threads and was lucky to get it solved. Thanks all for the help. Just for other’s help. The hint above that the bench path is incorrect was the first step in identifying the problem. I then deleted all the wrong directories.

I then followed Bench update fails: /bin/sh: 1: ./env/bin/pip: not found - #9 by kdevloper

Then I found nginx was not working and fixed it’s issues. FInally a reboot did the job.

1 Like