3

从技术上讲,我已经使用安装了 pandas-profiling

pip install pandas-profiling

但是当我尝试导入它时,我收到以下错误:

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'

第一个错误图像

所以我尝试在 Jupyter Notebook 中安装它,也得到了以下错误:

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

第二个错误图像

我也无法使用 conda 安装它,因为由于某种原因我无法建立与 conda.anaconda.org 的连接。

4

6 回答 6

6

对于希望解决此问题的其他人,请尝试以下替代步骤:

  1. pip install pandas-profiling在 jupyter notebook 的单独单元格中运行命令。
  2. 在此之后只需重新启动内核并再次运行。这绝对应该有效。为我工作。
于 2019-09-28T17:02:05.633 回答
2

根据评论,我能够找出问题所在。我必须在 Anaconda root 环境之外安装 jupyter notebook 并从终端打开它。

pip3 install jupyter notebook

一旦我这样做了,它就会正确导入。

于 2019-06-25T14:29:38.020 回答
0

脚步:

  1. 下载压缩包
  2. 打开 Anaconda Prompt 并转到目录并将文件解压缩到文件夹

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

  1. 然后输入 python setup.py install

  2. 现在您可以使用:

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

参考:熊猫分析

于 2019-08-07T06:54:50.193 回答
0

来自 Anaconda 提示:

conda install -c conda-forge pandas-profiling

于 2022-02-08T02:43:28.413 回答
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)  

注意:这在 Windows 10 上对我有用

于 2021-10-09T12:21:16.237 回答
0

只需打开 anaconda 提示符并输入: pip install pandas-profiling

/////////////////////////////开始->anaconda提示符->[cmd文件图标]->运行作为管理员

你摇滚!!

于 2022-02-12T09:27:53.480 回答