The most popular advice on the internet for `error: externally-managed-environment` is to force packages to be system installed

I don’t think we can do much about this:

  • Packages telling users to pip install are correct for the majority of cases. For the rest, it needs more context which would just mean that people start complaining that “installing Python packages is too complicated”.
  • The actual message isn’t even provided by the packaging tool, it comes from the distribution maintainers. I doubt they know any better how to advise someone who doesn’t even know what the “system package manager” is…
  • We can’t remove the “do it anyway” option, as people have presented important use cases where it’s needed. But nor can we prevent people using it inappropriately.
  • If anyone knows how to solve the problem of bad advice on the internet, Python packaging probably isn’t the first thing they should work on :slightly_smiling_face:

I agree with the assessment that tools like virtual environments and pipx are too much of a barrier. But venv is a stdlib tool - if people don’t know how to use python -m venv, or that they should, that’s on basic “learning Python” level training. Which isn’t something that it’s pip’s responsibility to provide.

I’d like to see something like pipx run built into the core Python interpreter, but I don’t think the core developers have the appetite for that, and the whole “packaging should be separate” idea works against it ever happening :slightly_frowning_face: And the people finding this type of issue hard aren’t going to be able to install pipx for themselves either.

The reality is that a huge number of newer Python programmers simply don’t formally learn Python, or even good development practices. They pick stuff up by grabbing snippets of the web (or nowadays, asking ChatGPT) and they don’t have any mechanism for checking that the advice they are getting is good or bad. We can’t expect development tool maintainers to take on the role of teaching people the basics of development.

15 Likes