Search code examples
pythonkerasanaconda

AttributeError: module 'keras' has no attribute '__version__'


import keras
keras.__version__

When I'm working in a .ipynb notebook in VSCode, I'm importing Keras. Then, to confirm Keras is loaded properly, I'm asking what version of Keras is "running". It gives the following error.

AttributeError: module 'keras' has no attribute '__version__'        

I'm using Anaconda latest build with base-env. I'm on macOS.


Solution

  • Try this

    import tensorflow as tf
    print(tf.version.VERSION)