You shouldn't use pip directly because you don't know which version is the one in your path. Ok: the same applies to the python command?
Calling pip is version ambiguous, but so is calling python.
You shouldn't use pip directly because you don't know which version is the one in your path. Ok: the same applies to the python command?
Calling pip is version ambiguous, but so is calling python.
The only situations where I've encountered breakage is pydoc (because your virtualenv does not necessarily have its own pydoc, contrary to having pip) and calling pip from a Jupyter notebook: the current kernel's virtualenv is not necessarily activated (the solution is the %pip magic or `!{sys.executable} -m pip` since `!python` would have the same issue).
So this security concern applies when you trust your shell and all the directories in your PATH, but you don't trust the contents of the current directory. That's not the norm, but it's quite a common situation to be in - you downloaded some files but don't intend to execute them.
This is (used to be at least) different on Windows: typing "python" risks executing a file in the current directory called "python.exe", though maybe UAC saves you now.