Open vx1920 opened 4 years ago
pip already shows the installer information in the verbose output (pip list -v
). It should satisfy your need if Conda provides that information (and you’ll need to ask Conda to provide the info if it doesn’t already do).
I already wrote that "pip list -v" provide additional column "Installer" with irrelevant information. If you don't believe - open first Details marker in my original post and review first two lines. In my system I have package "adal" installed by pip, while next package "alabaster" installed by conda. Your "pip list -v" marks both of them as "pip". With my new column I can see "alabaster" marked as "Anaconda", while "adal" marked "ThePip". I decide to combine both columns (old "Installer" and my new "Owner") to illustrate that "Installer" column contains something useless.
It’s a conda bug if packages it installs do not report the installer correctly. I don’t think pip should be responsible for fixing things other tools do wrong.
I am not sure that it is conda bug, but I am sure that conda developers will tell you and me that there is no any bug in conda and conda itself can provide ability to update conda-only packages ("conda update --all"). Also "installer=pip" may legitimately indicate that conda uses "setuptools" (it is general tool used both by pip and conda) to install some particular package. Some other conda tools may set marker as "conda". Conda has tracking items installed by conda and pip should do the same. If I use "pip list --outdated" - it should inform about outdated packages installed by pip and don't care about items installed by conda. My option solves this problem somehow by adding extra marker column. Mybe it is better to have special option "pip list --outdatedpip", but with my option I could do some system cleanup by uninstalling pip packages and installing same name conda ones. Maybe somebody else you can consider my option as useful. Any case: I have it now, I use now and I solve some of my problems.
I concur with @uranusjr - pip reports the value in the INSTALLER
metadata file. If conda populates that fire correctly, pip will report as you wish. If conda don't do so, they are not respecting the existing interoperability standard, and it's not down to pip to work around that problem.
I've encountered the problem where pip list
will report the newer version of a package installed by conda (and vice versa, see: https://github.com/conda/conda/issues/9924). When I removed the newer package from conda then pip list
will change to suddenly show the older version of that package. Presumably the one that was installed with pip in the first place.
I don't know where in the interaction between pip and conda that the problem lies. But in any case it seems inconsistent of the output of pip list
to rely on activities conducted within conda.
@redbar0n As has been noted above, the fix here is for conda to follow the existing standards for recording installed packages. If they can't do that (they have their own processes, which may or may not work well alongside the packaging standards) then pip and conda will never be able to interoperate completely seamlessly.
As an aside, conda developers are more than welcome to participate in packaging standards discussions, in the same way that, for example, Linux distro packagers do. So far, we've had very little involvement from them, so it's unfortunate but not exactly unexpected that awkward interactions like this crop up occasionally.
I am using Anaconda, some packages installed by conda, but some other avalable only from "pip install". I have problem with packages updates, since Anaconda packages should be updated with conda and pip packages should be updated respectively with pip (normally).
Updating of conda packages can be done properly using "conda update --all", but "pip list outdated" reports all outdated packages, including just updated conda ones. Problem is that some packages can be installed in both ways and ones from pip are oftenly newer, since Anaconda doing prpagation with some delay. Normally it is better to use slightly older conda-installed packages with conda, but pip-only packages have to be updated and I want to see who did install package originally. There is optional column "Installer" in "pip list format=columns -verbose" with pip/conda values inside, but experiments shows this information is useless for me. It may just indicate that package uses metadata in "*dist-info" folder format and it is true for many conda-installed packages.
Solution: I need additional column with additional information. My new suggested output format can be enabled using new option "format=columnsx". Pay attention to new column "Owner" with "Anaconda"/"ThePip" values. You can also see that column "Installer" is useless, while new "Owner" is more useful...
This new option is most useful with "pip list --outdated". In the example below it shows: all outdated items are from conda and pip update is not needed.
I have Win-X64, conda version : 4.8.3, conda-build version : 3.18.11, python version : 3.7.7.final.0. I did modify my local pip 20.0.2, everything works good for me, see above. We can discuss these changes more if it will be considered as new useful feature for "pip list". Old behavior completely unchanged, new feature available only with new option.