Why there are pip and conda packages after fresh installation?

陌路散爱 提交于 2021-02-18 21:08:34

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/35446485/why-there-are-pip-and-conda-packages-after-fresh-installation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!