guagay_wk
guagay_wk

Reputation: 28090

How to list outdated pip packages only on anaconda?

I would list out all the outdated python packages only installed using pip in anaconda. Conda packages are not to be displayed.

If I run pip list --outdated, all outdated packages, both pip and conda, are displayed. I want to display only outdated pip packages.

I am using anaconda python v3.6 64-bit on Windows 10.

Upvotes: 0

Views: 967

Answers (2)

vx1920
vx1920

Reputation: 56

Answer is incorrect: "pip list --outdated" will return all outdated packages, including ones installed by conda, even you just did "conda update --all". This is because there is some delay in propagation of packages from "pip" repository to "conda" one. In general it is not recommended to update conda installed packages by pip (unless you really need it and know what you are doing, but again it is better just to wait few weeks).

Same story with "conda list" - it will report all installed packages. Channel name "pypi" may indicate that package was installed by "pip", but it is unnecessary reliable, since you can use other channels in pip and use "Pypi" channel with conda.

Back to pip. Theoretically there is option "-v" available in "pip list [--outdated]". It will provide additional column "Installer" with pip/conda text in it. Really this information is completely irrelevant, since conda placing "pip" or "conda" randomly.

I did create issue in github/pip. See more details there. Shortly speaking: nobody want to fix it right way, so I have to use my own not perfect workaround to solve this problem for myself. https://github.com/pypa/pip/issues/8415

Upvotes: 1

Reblochon Masque
Reblochon Masque

Reputation: 36722

You can do a set difference between:

All all pip outdated packages obtained with:

$ pip list --outdated

And all conda installed packages obtained with:

$ conda list

This will remove the outdated packages previously installed with conda from the list returned by pip list --outdated, giving you the list of outdated packages installed via pip.

Upvotes: 1

Related Questions