user@erp:~/frappe-bench$ bench setup production user
superuser privileges required for this command
user@erp:~/frappe-bench$ sudo bench
sudo: bench: command not found
user@erp:~/frappe-bench$ sudo adduser user sudo
The user user' is already a member of sudo’.
user@erp:~/frappe-bench$ sudo bench
sudo: bench: command not found
This means the command ‘bench’ is not in that list of directories identified by $PATH.
When you sudo, you get a preconfigured $PATH, which is (supposed to be) something like the root user’s default path. Your program is not in that list of directories identified by $PATH.
I have exactly same problem. No chance. If command not found yeah it may not be in path . But neither giving full path nor defining enviroment variable under root worked.
What about python aliases? As i am not linux expert i clearly don’t understand which python verison exactly we should use. It seems to me both pyton2 and python3 are used
Well, in any case there’s no note or emphasis here to never use (nor have to use ie precede) the bench command with sudo.
But if you have no choice and must use sudo - say to skip over a permission denied violation - then in the install likely you introduced a file ownership issue (that can easily be fixed with chown).
I am not sure what the original poster’s problem was, as Linux distros differ in ‘subtle opinionated’ ways for eg use visudo to specify sudo privileges
ERPNext uses virtualenv to maintain its own Python toolchain environment (separate from the host OS that typically uses a Python version too), and starting with version 12 moved to 3.5+ from 2.7
Well. Everything what i am trying to do is standard ERP next installation on fresh installed centos 8 . Also there is no special case ,restriction etc
bench setup nginx
command working well under erp user. But supervisor command not working.
I had tried ;
bench setup supervisor
with full path ( ./bla bla/bench )
with sudo ( sudo bench setup supervisor)
with root ( # bench setup supervisor)
with/without root enviroment variables (su erp/su - erp && bench setup supervisor )
Problem seems something related with supervisor.
I am following this guide ( just like standard manual installation guide but more clear )
I had passed all of the step and erpnetx working on dev mode. But when i try to install production mode i hit to wall.
cd ~
git clone https://github.com/frappe/bench bench-repo;
sudo pip3 install frappe-bench; #NB!!! MUST be sudo'd!!!
#if you exclude the sudo part, then the sudo bench commands required later (for production mode) will fail!
Is this really standard procedure in setting up production?
Because I don’t think I ever see to use sudo on any documentation (or maybe I’m just not looking enough)
Now, if the repo had been installed (convert from dev) what should we do?
If you check the scripts here for debian or here for ubuntu - there is a point in the installation where you MUST use sudo, otherwise you cannot set up supervisor (required for production) correctly