← Back to context

Comment by CamperBob2

7 days ago

NEVER recommend using "pip install" directly, always recommend "python3 -m pip install"

Just out of curiosity, what's the difference?

Seems like all the cool kids are using uv.

When you do `python -m pip install` you're going to get a version of pip that has the same idea of what its environment looks like as the python executable, which is what you want, and which isn't guaranteed with the the `pip` executable in your path.

As an aside, I disagree with the `python3` part... the `python3` name is a crutch that it's long past time to discard; if in 2025 just typing `python` gives you a python 2.x executable your workstation needs some serious updating and/or clean-up, and the sooner you find that out, the better.

  • Perhaps, but that's not really up to users. Linux distributions, for example, control this pretty directly. You can alias it, but why bother? If you know that Ubuntu links python3, every Ubuntu installation that gets python from apt is going to do this.

    • Yes, but on all reasonably recent distros (including all current "LTS" releases) just `python` will also get you python 3.x. If there is still a python 2.x on your system you'll have to type `python2` to get it. So it is up to the user... to upgrade their system. You really don't want to work on a system that's so outdated that `python` is still python 2.x.

You mean to say that there is a lot of hype for uv because it is nice and quick but also gives an easy rhetorical win for junior people in any discussion about packaging in Python currently, so obviously that's going to be very popular even if it doesn't work for everyone.

The difference is to try to decouple the environment from the runtime essentially.

I only recently switched to uv and previously used pyenv, so this was more relevant to me before. There is a case when pip might not be pointing to the right python version, while `python3 -m pip` ensures you use the same one as your environment. For me it is mostly a habbit :)

If you ever find yourself arguing about the best Python package manager then you've already lost. Just use a real language with real library management. I dropped Python for Go and haven't looked back. There's plenty other alternatives. Python is such a waste of time.

uv? guess I'm old school.

pip install it is for me

  • There's nothing old school / cool kids about uv and pip. uv is a pip/venv/... interface. If you know how to use pip and venv, you know how to use uv. I use it as a useful toolchain to circumvent missing project/setup.py/requirements shenanigans