3

I was creating a new env in anaconda and after installing spyder, tensorflow and theano I attempted to install keras but I got an error message (see below). Now I cannot even open spyder as it stops working. Spyder only works if I uninstall keras again.

Do you have any idea what could be going on? I have another env in this same computer that works perfectly with the same packages installed.

(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
)
  • Please refer to this answer. I now am able to run Anaconda Prompt again https://stackoverflow.com/a/54237245/8902456 – Muser Jan 17 '19 at 14:00

3 Answers3

0

It may sound really obvious, but did you try installing it with pip ?

user8075709
  • 115
  • 2
  • 9
  • I wasn't able to fix that environment. I created another one and installed with pip from the very first time and that worked. For some reason, installing keras via conda was breaking spyder. Thank you! – Carlos Galicia Jun 17 '18 at 23:41
0

I've resolved this by uncommenting everything inside the keras_activate.bat and keras_deactivate.bat file of my conda environment. You can locate this under %HOME%\Anaconda3\envs\<env_name>\conda. Btw, I have my keras working with tensorflow backend by default.

Derrick
  • 3,669
  • 5
  • 35
  • 50
Junelle Rey
  • 396
  • 3
  • 5
0

I've tried

conda install -c anaconda keras-gpu

for installing keras and it worked.

keikai
  • 14,085
  • 9
  • 49
  • 68
rohan
  • 1