Recently, Frappe updated its dependencies for
version-14 to python > 3.10.
If you’re on
version-13, try to upgrade to python3.8 instead.
Here’s what I did to upgrade to python3.10 under Ubuntu 20.04.
Remember to take a backup of your server first!
Install custom PPA, so Ubuntu knows where to find python3.10:
sudo apt install software-properties-common -y sudo add-apt-repository ppa:deadsnakes/ppa
Install required python packages:
sudo apt install python3.10 python3.10-dev python3.10-distutils
Switch to your bench directory:
Move your old python
env folder to
env-old. This way you make space for the new env while keeping a copy to restore in case something goes wrong.
mv env env-old
Create a new python environment with python3.8
virtualenv --python python3.10 env
In case the above command doesn’t work (I had problems on one machine) you can try this alternative:
# OPTIONAL: only if the above failed python3.10 -m venv env
Upgrade pip to the newest version. The later commands will fail in case your pip version is too old.
env/bin/pip install -U pip
Now we can reinstall our apps and their dependencies. Here I only show frappe and erpnext. Please append all your custom apps to the command like this:
env/bin/pip install -e apps/frappe -e apps/erpnext
I like to run
bench update at the end to see if everything worked:
bench update --reset
If everything went well, you can delete your old env (optional, use with care):
rm -rf env-old
Didn’t test this properly yet, but if you get errors from socketio in your browser console, this can possibly be fixed by:
bench setup supervisor bench restart --supervisor