OS upgrade broke frappe

Hi guys. We recently upgraded the OS from debian 9 to 11 on a working frappe installation and now frappe is not working. I think it is an issue with a new version of python. Could anyone assist on how to fix? Thanks

You can use pip to install/uninstall the required python version

Thanks. python is installed but for some reason bench is not starting. Should I post logs here?

You can post the logs, also try bench setup requirements, it installs the required libraries and versions.

Thanks. Tried now and this is the outcome of the command:

frappe@agricom:~/frappe-bench$ bench setup requirements
Updating Python libraries…
INFO:bench.utils:./env/bin/pip install --upgrade pip==9.0.3
Cache entry deserialization failed, entry ignored
Requirement already up-to-date: pip==9.0.3 in ./env/lib/python2.7/site-packages
You are using pip version 9.0.3, however version 23.0.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.
INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/agricom-bench/requirements.txt
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-C2JBPB/python-crontab/
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/agricom-bench/bench/cli.py”, line 40, in cli
File “/home/frappe/.local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/.local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/.local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/.local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/.local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/.local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/agricom-bench/bench/commands/setup.py”, line 161, in setup_requirements
File “/home/frappe/agricom-bench/bench/commands/setup.py”, line 167, in setup_python_requirements
File “/home/frappe/agricom-bench/bench/utils.py”, line 432, in update_requirements
install_requirements(pip, bench_req_file)
File “/home/frappe/agricom-bench/bench/utils.py”, line 500, in install_requirements
exec_cmd(“{pip} install -q -r {req_file}”.format(pip=pip, req_file=req_file))
File “/home/frappe/agricom-bench/bench/utils.py”, line 160, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q -r /home/frappe/agricom-bench/requirements.txt

It seems you’ve used Python2.7 to create the bench (./env/lib/python2.7/site-packages gave it away). I’m assuming you want to install a newer version of Frappe, all of which are pinned with some major release of Python3.

Delete the env folder in your bench and setup a new environment python3 -m venv env && bench setup requirements

1 Like