close

[Solved] No module named ‘absl’ error when I import tensorflow

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error No module named ‘absl’ error when I import tensorflow in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How No module named ‘absl’ error when I import tensorflow Error Occurs?

Today I get the following error No module named ‘absl’ error when I import tensorflow in python.

How To Solve No module named ‘absl’ error when I import tensorflow Error ?

  1. How To Solve No module named 'absl' error when I import tensorflow Error ?

    To Solve No module named 'absl' error when I import tensorflow Error I was getting the error even though absl-py was already installed.

  2. No module named 'absl' error when I import tensorflow

    To Solve No module named 'absl' error when I import tensorflow Error I was getting the error even though absl-py was already installed.

Solution 1


This was caused by a Python version issue for me. I had the absl package installed on my Python 2.x, but my Python 3.x didn’t have it. So I just made sure that both Pythons on my machine had the package installed:

pip install absl-py
pip3 install absl-py

Solution 2

Here is how I solved it in my end.

I was getting the error even though absl-py was already installed.

When I used pip install absl-py I got the following error:

Requirement already satisfied: absl-py in c:\users\stack\appdata\local\programs\python\python38\lib\site-packages (0.9.0)
Requirement already satisfied: six in c:\users\stack\appdata\local\programs\python\python38\lib\site-packages (from absl-py) (1.15.0)

I fixed it by reinstalling, i.e. by using:

pip uninstall absl-py
pip install absl-py

Then I faced a similar error with wrapt: ModuleNotFoundError: No module named 'wrapt'

Fixed wrapt as well by uninstalling and then installing it again.

pip uninstall wrapt
pip install wrapt

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read