我在我的 Python Khernel 中,准确地说是虚拟内核,然后我运行了以下代码
from ydata_profiling import ProfileReport
但是,我不断收到错误消息
ModuleNotFoundError Traceback (most recent call last)
Cell In\[10\], line 1
\----\> 1 from ydata_profiling import ProfileReport
ModuleNotFoundError: No module named 'ydata_profiling
请问我该如何解决这个问题?
我已尝试安装
ydata_profiling
的软件包,但仍然无法正常工作。
我使用的代码
conda install ydata_profiling
错误信息
(nativenerd) imac@IMACs-iMac ~ % conda install ydata_profiling
Channels:
- defaults
Platform: osx-64
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- ydata_profiling
Current channels:
- defaults
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
我希望安装该软件包并且
Solving environment: Success
您收到错误,因为默认渠道无法提供该软件包。要解决此问题,您需要将 conda-forge 通道添加到 conda 配置中,并将通道优先级设置为 strict。这将确保 conda 首先在 conda-forge 通道中查找包。在终端中记下这些命令:
conda config --add channels conda-forge
conda config --set channel_priority strict
然后您可以尝试再次安装 ydata_profiling:
conda install ydata_profiling
尽管如此,我个人使用 pip 来安装所需的软件包:
pip install ydata_profiling