Dear Frappe community,
I bought a new laptop with Ubuntu 24.04 LTS OS ,
I couldn’t install frappe-bench using pip3 install method, This is what I got:
~$ pip3 install frappe-bench
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.12/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Please anyone could help ?
for your information I used pipx install after I installed pipx package , I installed , the frappe-bench using :
pipx install frappe-bench
then
cd frappe-bench
but I couldnot initiate the bench,
bench init frappe-bench , does not work,
here is what I got:
$ bench init frappe-bench
Setting Up Environment
$ python3 -m venv env
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt install python3.12-venv
You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.
Failing command: /home/faris/bench-0/bench-0/env/bin/python3
subprocess.CalledProcessError: Command 'python3 -m venv env' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/faris/.local/share/pipx/venvs/frappe-bench/lib/python3.12/site-packages/bench/commands/make.py", line 75, in init
init(
File "/home/faris/.local/share/pipx/venvs/frappe-bench/lib/python3.12/site-packages/bench/utils/render.py", line 105, in wrapper_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/faris/.local/share/pipx/venvs/frappe-bench/lib/python3.12/site-packages/bench/utils/system.py", line 66, in init
bench.setup.env(python=python)
File "/home/faris/.local/share/pipx/venvs/frappe-bench/lib/python3.12/site-packages/bench/utils/render.py", line 126, in wrapper_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/faris/.local/share/pipx/venvs/frappe-bench/lib/python3.12/site-packages/bench/bench.py", line 362, in env
self.run(f"{venv} env", cwd=self.bench.name)
File "/home/faris/.local/share/pipx/venvs/frappe-bench/lib/python3.12/site-packages/bench/bench.py", line 48, in run
return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/faris/.local/share/pipx/venvs/frappe-bench/lib/python3.12/site-packages/bench/utils/__init__.py", line 169, in exec_cmd
raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: python3 -m venv env
ERROR: There was a problem while creating bench-0
Do you want to rollback these changes? [y/N]: