Hello everyone, i tried almost everything but stuck at this error while installing erpnext v14.
I’m using UBUNTU 24 LATEST AS A OS in my system.
frappe@Rahul:~$ sudo 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.
Any help appreciated, Thank You
issue has been sorted out after installing ubuntu 22 and erpnext scripts
Can you explain more?
How was the problem resolved?
Thank you
I deleted everything and re-installed ubuntu and then use the script to install the ERPNEXT.
To explain more … The repos for Ubuntu 23.10 install python 3.11 & for 24.04 that’s 3.12. Starting in 3.11 there’s now a requirement to use a venv when installing stuff - otherwise “sudo pip3 install frappe-bench” should give “error: externally-managed-environment”
See: python - pip install -r requirements.txt is failing: “This environment is externally managed” - Stack Overflow
and: PEP 668 – Marking Python base environments as “externally managed” | peps.python.org
/usr/lib/python3.12/EXTERNALLY-MANAGED is just an empty marker file and removing it causes Python to revert to the way it behaves in 3.10. See also: Installing ERPNext version 15 on Ubuntu 23+
You should see in the erpnext_quick_install script at line 338 it does just that.
Is this script is secure to use?
I have also same problem. I am trying many way but cannot solved it. can any one help me please??
Hi Arif981
Sadly - many install procedures for ERPNext date to python 3.10 (Ubuntu 22.04) or earlier. Now - python (from 3.11) requires pip3 to be used with a virtual environment - otherwise you get this error. Best practice - especially for production - is to learn to use virtual environments. Or - use pipx instead of pip3 - which simplifies the venv procedure. My earlier suggestion should be seen as a workaround.