【问题标题】:Spyder crashing after installing Keras through Conda通过 Conda 安装 Keras 后 Spyder 崩溃
【发布时间】:2019-07-22 11:01:46
【问题描述】:

我在 PC 上下载了 Anaconda。我想使用 TensorFlow 和 Keras。我知道我必须使用 Python 3.6 和 TensorFlow 1.0.9(因为我的代码)。

安装 Anaconda 后,我打开 Anaconda 提示符(在管理员中),然后输入这些说明来创建一个新环境:

conda create --name deeplearningaz python=3.6 anaconda
activate deeplearningaz
conda install theano
conda install tensorflow
conda install keras
conda update --all

我没有任何错误,但有关于更新 Conda 版本的警告,以及一些调试消息。

之后,我尝试检查我是否使用了正确版本的 Python,因此我键入(仍在 Anaconda 提示符中)并导入 keras(查看是否正常):

python
import keras

一切正常。 然后我输入quit() 并输入spyder(在Python 3.6 的环境中打开Spyder)。 Spyder 打开,如果我输入任何内容(导入 pandas、numpy 等读取 csv),它就会崩溃……无缘无故(也没有错误)。

之后,仍然在 Anaconda 提示符下,我再次尝试打开 Spyder,但出现错误:

我不明白这个问题,我一次又一次地尝试卸载和安装 anaconda(并检查我的文件是否真的被删除了)。我没找到... 我检查了print(sys.path),看起来没问题(但我没有看到环境)。

有人知道吗?

我将环境中的 conda 信息放在这里(崩溃前)。

【问题讨论】:

    标签: python-3.x keras conda spyder win64


    【解决方案1】:

    我不使用 Spyder,但基于 this discussion about how they don't really support switching conda envs yet,听起来目前让 Spyder 使用 Conda env 的正确方法是从 env 外部启动 Spyder,然后更改 Python 解释器(Tools > Preferences > Python Interpreter)指向您希望使用的环境中的python

    或者,如果您真的不关心空间,只需在 env (conda install -n deeplearningaz spyder) 中安装一个新的 Spyder 实例,然后您应该能够在 env 中毫无问题地启动。

    【讨论】:

      猜你喜欢
      • 2018-06-11
      • 2021-08-24
      • 2022-01-19
      • 2019-08-04
      • 1970-01-01
      • 2020-11-21
      • 2022-01-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多