'Unable to import 'pandas_profiling' module

I have installed 'pandas_profiling' through conda install -c conda-forge pandas-profiling in the base environment. I could see through the conda list that pandas_profiling has been installed correctly (snapshot attached), enter image description here

When I try to import pandas_profiling I receive ModuleNotFoundError

import  pandas_profiling
Traceback (most recent call last):

  File "<ipython-input-4-60d2bac64bfc>", line 1, in <module>
    import  pandas_profiling

ModuleNotFoundError: No module named 'pandas_profiling'

Update: output of import sys; print(sys.path); print(sys.prefix)

['/home/user1/miniconda3/lib/python38.zip', '/home/user1/miniconda3/lib/python3.8', '/home/user1/miniconda3/lib/python3.8/lib-dynload', '', '/home/user1/miniconda3/lib/python3.8/site-packages', '/home/user1/miniconda3/lib/python3.8/site-packages/IPython/extensions', '/home/user1/.ipython']

/home/user1/miniconda3


Solution 1:[1]

This is a frequent issue, check out this entry in the FAQ.

Solution 2:[2]

Occasionally you will encounter this error if you import a package from the current notebook. It is important to ensure that the pip version is associated with the current Python kernel. That way, the installed packages can be used in the current notebook.

As detailed here, the shell environment and the Python executable are disconnected.

This should work for you

import sys
!{sys.executable} -m pip install pandas-profiling

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Simon
Solution 2 Kavingwa Keya