I was sure that I was using pip without any problem, now every-time I use it I get the error:
This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
python-xyz', where xyz is the package you are trying to
install.
If you wish to install a non-Arch-packaged Python package,
create a virtual environment using 'python -m venv path/to/venv'.
Then use path/to/venv/bin/python and path/to/venv/bin/pip.
If you wish to install a non-Arch packaged Python application,
it may be easiest to use 'pipx install xyz', which will manage a
virtual environment for you. Make sure you have python-pipx
installed via pacman.
You need to remove /usr/lib/python3.12/EXTERNALLY-MANAGED.
(replace 3.12 as necessary for your python version).
There may be a good reason for this existing (I know bugger-all about Python) but I removed it some time ago because I needed pip packages and I’ve never seen any deleterious effects.
[Edit]: I’ve just spotted that you can also use: pip install package_name --break-system-packages
if you prefer not to remove the file. Though it’s going to be a pain having to remember that every time you use pip.
Whatever deleterious effects there may be (and I haven’t seen any), it certainly hasn’t broken my OS. At worst it would only affect Python programs, not the OS itself.
This problem has been known for years! It’s nothing new, it’s just that pip is now blocking this bad installation method.
Did you know that an application has dependencies? And that an application is written to work with a certain version of its dependency. Here, you are disregarding pacman, so
a system python application (for example, pacman-mirrors) may no longer work with your intervention
If tomorrow, you install again with pip, you could break the dependency of the today application.
you are committing to managing updates for these dependencies yourself and manually.
If you want to take risks and manage your python packages yourself, that’s your problem. You just need to think about why you want to take this risk and this workload (if it’s out of laziness or wanting to maintain a very bad habit …)
hasn’t broken my OS
But at least break pacman updates (file conflicts)
only affect Python programs
can affect all application who use python !
example : inkscape, use some python packages, samba have some optional python packages, …
This system was created a year ago by Python, and you assume they did it and that every distribution adopted it without a valid reason…
From the moment I installed Manjaro, I already took a risk! I understand the concerns about managing Python dependencies and the potential risks involved. For less common packages, using pip is a standard and acceptable solution (I think), for instance I need to install the pandas-ods-reader package, which is not available through pacman. Therefore, I have to use pip to install it.