Modulenotfounderror: no module named ‘absl’

In this tutorial, we will help you to solve the modulenotfounderror no module named absl error you encountered.

The error occurs if the Python library cannot find the “absl-py” module installed or maybe its installed it in an incorrect path environment.

Why the modulenotfounderror no module named absl occur?

The no module named absl occur because you use the ‘absl’ package along with not installing in python library.

Also read: Modulenotfounderror: no module named ‘httpx’

Other cause of error

The error ModuleNotFoundError: No module named ‘absl’ appers for several reasons:

  • The absl-py module is not installed through executing the pip install absl-py.
  • Installing the absl-py module in a various version of python than the one you’re using.
  • Installing the module globally and not in the incorrect virtual environment.
  • You run the IDE in an incorrect Python version.
  • Maybe you name module absl.py that’s why it cause a duplicate in the official package.
  • Maybe you declare a variable named absl, so that’s why it cause shadow to the duplicate variable.

How to solve the no module named absl?

To solve the no module named absl we will provide the solutions below for the Windows Platform, Anaconda, and Jupyter Notebook.

Time needed: 3 minutes

Here are the solutions to solve the error no module named absl.

  • Solutions 1: Install absl-py in Python 2

    The following command below is the command to install the absl-py module in Python 2.

    pip install absl-py

    After you execute the command above, it will show like this:
    install absl in Modulenotfounderror no module named absl

  • Solutions 2: Install absl-py in Python 3

    The following command below is the command to install the absl-py module in Python 3.

    pip3 install absl-py

    After you run the command above, it will show like this:
    install absl pyhon 3 in Modulenotfounderror no module named absl

  • Solution 3: Install absl-py in py alias

    The following command below is the command to install the absl-py module in py alias.
    py -m pip install absl-py


    After you run the command above, it will show like this:
    install absl py in Modulenotfounderror no module named absl

  • Solution 4: Install absl-py in Anaconda

    The following command below is the command to install the absl-py module in Anaconda.

    py -m pip install absl-py

    After you run the command above, it will show like this:
    install absl anaconda in Modulenotfounderror no module named absl

  • Solution 4: Install absl-py in Jupyter Notebook

    The following command below is the command to install the absl-py module in Anaconda.

    !pip install absl-py

Check if the absl Module is Installed

You can check the absl module if it is installed through executing the command:

pip show absl-py

If the command above is executed it will show the package which is either it is installed or not.

if it is installed the system will show the details about the package.

Which are include the name, version, location, author, license and the summary.

Let’s have the example below:

Check if the absl Module is Installed Modulenotfounderror: no module named 'absl'

Conclusion

To conclude, we discuss the solutions to the error no module named ‘absl’ in windows platform, anaconda, and Jupyter Notebook.

I hope this tutorial can help you to solve the error you encountered.

Leave a Comment