pypa/pip — Issue #401: Don't use pkg_resources for reporting version with "pip --version"
Author: carljm
Created: 2011-12-12 06:26:58+00:00
State: open

Currently, pip relies on `pkg_resources.get_distribution('pip')` to report what version of pip is installed, and where, when you run `pip --version`. Unfortunately, this sometimes does not provide a useful answer (e.g. when running a pip that is not "installed"), and sometimes provides an entirely wrong answer (when there is an installed pip, but there is also a not-installed pip package that is higher on sys.path than the installed one - in this case the latter one will actually be run, but `--version` will report the installed one).

It would be better if we used a simpler technique, like "import pip; pip.__file__" to report which pip is running and from what location. For version, this would require introducing a pip.__version__ attribute (in which case we should probably also parse that for use in setup.py and docs/conf.py).