- #1
- 970
- 670
This page gives three ways to bypass the "externally managed environment" error when trying to install python packages globally.
https://www.makeuseof.com/fix-pip-error-externally-managed-environment-linux/
But it also says,
So it would seem that the first method (delete the EXTERNALLY-MANAGED file) may create more problems than it solves.
But how about the third method - installing and using "pipx" ? Are there any pitfalls here, or does it take care of the package management conflicts?
=======================
Edit:
Sorry, just noticed that the same page does say this:
This suggests that pipx should be a safe and trouble free solution.
But I can't delete a new post, and anyway if someone has used pipx they might care to weigh in and share how well it actually works.
https://www.makeuseof.com/fix-pip-error-externally-managed-environment-linux/
But it also says,
The latest versions of all Linux distributions are adopting the standards defined in PEP-668. These changes ensure that pip packages will not be installed in a global context by default.
This was implemented in an attempt to avoid conflict between the distribution's package manager and Python package management tools.
So it would seem that the first method (delete the EXTERNALLY-MANAGED file) may create more problems than it solves.
But how about the third method - installing and using "pipx" ? Are there any pitfalls here, or does it take care of the package management conflicts?
=======================
Edit:
Sorry, just noticed that the same page does say this:
It automates steps like creating virtual environments for each package and creating symbolic links to the packages in the .local/bin folder so you can call each package from the shell at all times.
Using pipx to install packages helps you avoid the "externally-managed-environment" error as it installs packages in virtual environments.
This suggests that pipx should be a safe and trouble free solution.
But I can't delete a new post, and anyway if someone has used pipx they might care to weigh in and share how well it actually works.