We Are Going To Discuss About ModuleNotFoundError: No module named ‘keras.api’ error. So lets Start this Python Article.
ModuleNotFoundError: No module named ‘keras.api’ error
- How to solve ModuleNotFoundError: No module named 'keras.api' error
I am not sure how keras 2.3.4 is installed but minimum version of keras for tf 2.8 is 2.8; Just upgrade your keras version
pip install keras==2.8
- ModuleNotFoundError: No module named 'keras.api' error
I am not sure how keras 2.3.4 is installed but minimum version of keras for tf 2.8 is 2.8; Just upgrade your keras version
pip install keras==2.8
Solution 1
I am not sure how keras 2.3.4 is installed but minimum version of keras for tf 2.8 is 2.8; Just upgrade your keras version
pip install keras==2.8
Original Author Sadra Of This Content
Solution 2
Since version 2 of Tensorflow (TF), the Keras package comes installed alongside. Meaning that if you make pip install tensorflow
, will install the latest TF version (2.8) and Keras 2.8. As the other answer suggests, I would guess you have some old Keras version installed on your computer.
My advise would be to create a fresh virtual environment,
python3 -m venv ENV_DIR
and then freshly install all the requirements that your .py
file needs from scratch. This will hopefully solve your issue and it is also best practice not to mess with different Python packages versions throughout your projects.
Original Author Nicolas Perez de Olaguer Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.