0
votes
import keras

Runs in the following error. My python is installed with Anaconda and I have done pip install Tensorflow / Keras / Numpy

ImportError                               Traceback (most recent call 
last)
<ipython-input-7-c74e2bd4ca71> in <module>()
----> 1 import keras

/Users/florianfontaine-papion/anaconda2/lib/python2.7/site-
packages/keras/__init__.py in <module>()
  1 from __future__ import absolute_import
  2 
----> 3 from . import utils
  4 from . import activations
  5 from . import applications

/Users/florianfontaine-papion/anaconda2/lib/python2.7/site-packages/keras/utils/__init__.py in <module>()
  1 from __future__ import absolute_import
----> 2 from . import np_utils
  3 from . import generic_utils
  4 from . import data_utils
  5 from . import io_utils

ImportError: cannot import name np_utils
1
Which version of Keras did you install? and what are the contents of the folder /Users/florianfontaine-papion/anaconda2/lib/python2.7/site-packages/keras/utils/ ? - Dr. Snoopy

1 Answers

-1
votes

First, check whether Keras is installed or not by running following command in terminal. If you are using python3, use python3 in place of python.

python -c 'import keras; print(keras.__version__)'

And if above command showing error do the following

  1. Open terminal and type this

    anaconda-navigator
    
  2. Go to Environments tab present on left side

  3. Select your destined environment
  4. It will list all the packages installed. In first dropdown select ALL and in search bar type keras
  5. It will list keras package. Select it and click apply at bottom
  6. Done