being on bench version 5.0 currently (where 5.3 is the latest version apparently) I am wondering whether bench will update itself to 5.3 in that process above or whether it was recommended to update bench manually?
if that needs to be done separately …
is it a bench update ran in a folder one level above the frappe-bench folder which updates bench?
should I do that prior to updating frappe/erpnext or after?
Gotcha. For any machine, there are 3 possible locations where Python saves packages.
If you install as normal user, Python packages are in $HOME/.local/lib/python3.x/site-packages/
If you install as root, packages are in /usr/local/lib/python3.x/site-packages/
(note: this may vary slightly between Linux distributions, or if you installed Python manually)
When using Python Virtual Environments (which Frappe does), you’ll find them inside whatever virtual environment directory was created. In your case, ../frappe-bench/env/
You don’t want to mess with ../frappe-bench/env. That is ERPNext’s virtual environment. While Bench created that for you, the contents have nothing to do with “Bench code”.
My advice is this.
Find your current Bench installation. You can identify where it’s located using
Take a backup. Then remove that older Bench.
Remember not to touch your frappe-bench directory or contents at all!
Install a fresh Bench app using Python3 and pip3:
pip3 install frappe-bench
Verify it installed correctly
Change your working directory to your ../frappe-bench/ directory.
Carry on and use Bench normally. All commands should be working fine. But Frappe and ERPNext themselves should be untouched.
Hopefully this makes sense. It’s a bit confusing because “Bench” is a separate app. But the default name of Frappe and ERPNext’s working directory is “frappe-bench”. Which is neither Bench, nor Frappe.
I sometimes install my environment with a completely different name, instead of “frappe-bench”, to avoid confusion.
TLDR → I believe that Bench now must be installed twice. First as a regular user. Then again as root user.
Explanation: @bkm and I were discussing this last month. We discovered several challenges during v13 installation.
In Bench 4.0 and earlier, the official instructions for installing Bench was using pip’s “editable mode”. This was the 'pip3 install -e .' command.
Now, Bench is available on PyPi.org. So we install using pip3 install frappe-bench. This command downloads Bench from PyPi, and installs on our machines.
Here is the problem:
Bench sometimes must be root (because it does things with apt, systemd, ansible)
Bench sometimes must be a regular user (all the other commands)
Python’s package system can be…painful. Partly because interpretive languages have more moving parts. But also because Python does some magic with symlinks, PATH changes, has no .lock file, virtual environments, etc.
When I installed Bench as a regular user, I could not make it run successfully as root. I tried changing my PATH variables. I even tried manually installing Bench inside a virtual environment. No luck. Even when it appeared like I was successful, Bench would always fail later with a “module not found” error.
Nothing I tried allowed for installing Bench once. But running both as regular and root.
Until someone provides a workaround, I think the easiest solution for you is installing Bench twice. Once as root, once as a regular user. I think this is awful, but it’s the only solution I have when installing from PyPi.
Alternately, you can still install Bench the old way, in pip’s editable mode. Bench 5.0 will raise warnings about this, and tell you editable mode is not recommended. But it does work.
sorry, I made a simple mistake. And I actually can access bench (without AND with sudo) by just addressing it right (~/frappe-bench/env/bin/bench instead of just bench). I guess that could be solved by editing the PATH as well.
I installed bench with sudo pip3 install frappe-bench
however I am running into toubles in the upgrade process (v11 → v12) then. I guess they are out of scope of this Topic.
Just one final thing … do you believe you need bench 5.x to upgrade v11 → v12 at all (which was the actual reason for this Topic to begin with)
I stepped back to the orignal point and did not do the manual bench upgrade, but tried the regular ERPNext upgrade process … in the middle of it I checked on which bench and got 5.0. It seems to be upgrage in the process as well at some point.