如果我有anaconda,我应该如何安装keras?

How should I install keras if I have anaconda?

如果我有anaconda,应该用哪个来安装keras?

conda install -c conda-forge keras

&

pip install --upgrade keras

另外,conda-forge 是什么?为什么需要这样做?

使用 conda 而不是 pip 在 Anaconda 环境中安装软件包的优点是:

  1. conda 应该确定您请求的包有哪些依赖项,并在一次操作中安装它们,并且
  2. 然后您可以 keep the installed packages up to date 使用 conda update 命令:

pip, PyPI, and setuptools?

None of this is going to help with updating packages that have been installed from PyPI via pip, or any packages installed using python setup.py install. conda list will give you some hints about the pip-based Python packages you have in an environment, but it won’t do anything special to update them.

conda-forge channel 是您可以找到为 conda 构建但不属于官方 Anaconda 发行版(目前)的软件包的地方。

有关这两个选项的更多详细信息,请参阅 this question 的答案(但请记住,某些答案可能已过时)。