0

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
pkj
  • 559
  • 1
  • 9
  • 21
  • How do you verify that the kernel running in IPython corresponds to the Conda environment where you installed the package? E.g., show us output of `import sys; print(sys.path); print(sys.prefix)`. – merv Jun 11 '21 at 19:38
  • I have updated my quesstion, is it something to do with Build of 'pandas-profiling = 0', as seen in the list. – pkj Jun 12 '21 at 01:03
  • Can you try making a new environment, but forcing a newer version? E.g., `conda create -n pp_test pandas-profiling=3 ipykernel`. – merv Jun 12 '21 at 04:46
  • environment was not created `Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.`, `PackagesNotFoundError: The following packages are not available from current channels: - pandas-profiling=3` – pkj Jun 12 '21 at 13:34

2 Answers2

0

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

Simon
  • 5,464
  • 6
  • 49
  • 85
0

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