5

I have technically already installed pandas-profiling using

pip install pandas-profiling

But when I try to import it, I get the following error:

import numpy as np
import pandas as pd
import pandas_profiling
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-e1a23f2a6f04> in <module>()
  1 import numpy as np
  2 import pandas as pd
  3 import pandas_profiling

  ModuleNotFoundError: No module named 'pandas_profiling'

First Error Image

So I tried installing it in Jupyter Notebook and got the following error as well:

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

 Collecting pandas-profiling
 Could not find a version that satisfies the requirement pandas-profiling 
 (from versions: )
 No matching distribution found for pandas-profiling

Second Error Image

I am also unable to install it using conda for both as I am unable to establish a connection to conda.anaconda.org for some reason.

Simon
  • 5,464
  • 6
  • 49
  • 85
genelaw03
  • 91
  • 1
  • 2
  • 9
  • 1
    Are you launching the notebook from your env that contains the modules? – mlenthusiast Jun 24 '19 at 23:27
  • I'm launching the notebook from inside the Anaconda root env. – genelaw03 Jun 25 '19 at 02:47
  • I think you don't have permission to install in root env, considering that you are a user. So you cannot use it from root env. You need to install it properly in the environment where you can write. – vb_rises Jun 25 '19 at 12:52

5 Answers5

6

To others who are looking to resolve this issue try these alternate steps :

  1. Run pip install pandas-profiling command in a separate cell in the jupyter notebook.
  2. After this just restart the kernal and run again. This should definitely work. Worked for me.
iPhoneDeveloper
  • 958
  • 1
  • 14
  • 23
3

Based on the comments I was able to figure out the issue. I had to install jupyter notebook outside of the Anaconda root env and open it from the terminal.

pip3 install jupyter notebook

Once I did that it imported properly.

genelaw03
  • 91
  • 1
  • 2
  • 9
1

From Anaconda Prompt:

conda install -c conda-forge pandas-profiling

kyramichel
  • 471
  • 5
  • 4
0

Steps:

  1. Download the ZIP
  2. Open Anaconda Prompt and go to the directory and extract the files to a folder

cd C:\Users\farah\Downloads\pandas-profiling-master\pandas-profiling-master

  1. Then type python setup.py install

  2. Now you can use:

import pandas_profiling as pp
df = pd.read_csv('1234.csv')
pp.ProfileReport(df)

Reference: Pandas profiling

Farah Nazifa
  • 909
  • 8
  • 14
0
!pip install pandas_profiling  # Run this from Jupytor notebook Ignore the warnings if any 
from pandas_profiling import ProfileReport #restart the kernel if throws error
ProfileReport(df)  

Note: This worked for me on Windows 10

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103