python - anaconda安装keras时报错./p KERAS_BACKEND= 0<temp.txt

标签 python tensorflow keras anaconda conda

我在 anaconda 中创建了一个新环境,在安装了 spyder、tensorflow 和 theano 之后,我尝试安装 keras,但我收到一条错误消息(见下文)。现在我什至无法打开 spyder,因为它停止工作了。 Spyder 只有在我再次卸载 keras 时才有效。

你知道会发生什么吗?我在同一台计算机上有另一个环境,它与安装的相同软件包完美配合。

(py36) C:\Users\LeicaMicroscope>conda install -c conda-forge keras
Solving environment: done

## Package Plan ##

  environment location: C:\Users\LeicaMicroscope\Anaconda3\envs\py36

  added / updated specs:
    - keras


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2018.4.16          |           py36_0         143 KB  conda-forge

The following NEW packages will be INSTALLED:

    keras:           2.1.6-py36_0      conda-forge

The following packages will be UPDATED:

    ca-certificates: 2018.03.07-0                  --> 2018.4.16-0      conda-fo
rge
    certifi:         2018.4.16-py36_0              --> 2018.4.16-py36_0 conda-fo
rge
    openssl:         1.0.2o-h8ea7d77_0             --> 1.0.2o-vc14_0    conda-fo
rge [vc14]

Proceed ([y]/n)? y


Downloading and Extracting Packages
certifi-2018.4.16    |  143 KB | ###################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(py36) C:\Users\LeicaMicroscope>set "KERAS_BACKEND="

(py36) C:\Users\LeicaMicroscope>python C:\Users\LeicaMicroscope\Anaconda3\envs\p
y36\etc\keras\load_config.py  1>temp.txt

(py36) C:\Users\LeicaMicroscope>set /p KERAS_BACKEND= 0<temp.txt

(py36) C:\Users\LeicaMicroscope>del temp.txt

(py36) C:\Users\LeicaMicroscope>python -c "import keras"  1>nul 2>&1

(py36) C:\Users\LeicaMicroscope>if errorlevel 1 (
ver  1>nul
 set "KERAS_BACKEND=theano"
 python -c "import keras"  1>nul 2>&1
)

最佳答案

这听起来很明显,但您是否尝试过使用 pip 安装它?

关于python - anaconda安装keras时报错./p KERAS_BACKEND= 0<temp.txt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50806075/

相关文章:

php - 使用Python插入MySQL二进制(8)字段

python - 在 python2.7 上安装 libxml 预构建二进制文件

tensorflow - 从 Tensorflow 2.0 中加载的saved_model 访问中间层

tensorflow - Keras 类型错误 : can't pickle _thread. RLock 对象

numpy - 将 Keras 模型的输出重新缩放回原始比例

python - 凯拉斯图像数据生成器 : why are the outputs of my CNN reversed?

python - 当子进程返回错误时,Python 中出现奇怪的挂起

python - 在 PyCharm 中保存时自动添加换行符?

python - tensorflow 2.3 : AttributeError: 'Tensor' object has no attribute 'numpy'

node.js - 在 Node.js 中加载 TensorFlow 卡住图 (.pb)