检查安装的库时我应该信任 conda 还是 pip?

Should I trust conda or pip when checking libraries installed?

当我在 conda 环境中时,'conda list' 和 'pip freeze' 显示不同数量的库。例如,'tensorflow-gpu' 列在 'pip freeze' 中,但不在 'conda list' 中。如果我想在这个环境下使用tensorflow-gpu,我是应该运行 pip install tensorflow-gpu 重新安装还是不需要?

我觉得你在用conda环境的时候。 conda 列表将显示同一 conda 环境共享的所有通用包。 'tensorflow-gpu' 出现在 'pip freeze' 而没有出现在 'conda list' 的原因是因为你使用 pip install 安装了 'tensorflow-gpu'(可能是你或者 IDE).在这种情况下,我相信 'tensorflow-gpu' 只存在于这个 python 项目下。实际上,关于这个主题有一个官方文档。

Issues may arise when using pip and conda together. When combining conda and pip, it is best to use an isolated conda environment. Only after conda has been used to install as many packages as possible should pip be used to install any remaining software. If modifications are needed to the environment, it is best to create a new environment rather than running conda after pip. When appropriate, conda and pip requirements should be stored in text files.

Use pip only after conda Install as many requirements as possible with conda then use pip.

Pip should be run with --upgrade-strategy only-if-needed (the default).

Do not use pip with the --user argument, avoid all users installs.

这里是 link