Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why there are pip and conda packages after fresh installation?

All

Windows 10, 64bit, d/l Anaconda 2.5.0 with Python3, 64bit and installed it

After fresh installation i type conda list, and, among packages, I see duplicates like

jupyter                   1.0.0                    py35_1
jupyter-client            4.1.1                     <pip>
jupyter-console           4.1.0                     <pip>
jupyter-core              4.0.6                     <pip>
jupyter_client            4.1.1                    py35_0
jupyter_console           4.1.0                    py35_0
jupyter_core              4.0.6                    py35_0

Is it normal, and why some packages (not all of them, just a few) have duplicates (not quite, there is - vs _) both in conda and pip?

What will happen if I do pip uninstall jupyter-core?

What should be policy toward such packages?

like image 473
Severin Pappadeux Avatar asked Feb 17 '16 01:02

Severin Pappadeux


People also ask

Is pip automatically installed with Anaconda?

Both pip and conda are included in Anaconda and Miniconda, so you do not need to install them separately.

Can you have both conda and pip?

Conda on the other hand can install Python packages as well as the Python interpreter directly. Occasionally a package is needed which is not available as a conda package but is available on PyPI and can be installed with pip. In these cases, it makes sense to try to use both conda and pip.

Is conda install same as pip install?

The fundamental difference between pip and Conda packaging is what they put in packages. Pip packages are Python libraries like NumPy or matplotlib . Conda packages include Python libraries (NumPy or matplotlib ), C libraries ( libjpeg ), and executables (like C compilers, and even the Python interpreter itself).


1 Answers

It's a known problem with the output of conda. The packages are installed only once, but due to differing naming conventions, they are listed twice. There is a (now closed) bug report about it: https://github.com/conda/conda/issues/1237

When you ask conda for a list of packages, this is what happens (or used to happen):

  • conda knows which packages were installed with conda.
  • conda calls pip under the covers to find packages that were installed outside of conda.
  • pip lists all packages, regardless of where they came from.
  • conda filters the output of pip by removing the packages installed with conda.

Afaict, the problem is with conda-installed packages that contain an underscore. pip replaces underscores with hyphens in its output. Therefore, conda fails to detect that it's a package installed by itself, and lists it as installed by pip. Of course, conda also lists the package with its original, underscored name as installed by conda. Hence the duplicates.

like image 191
Roland Weber Avatar answered Oct 07 '22 07:10

Roland Weber