在ipython笔记本上

在ipython笔记本上

本文介绍了在ipython笔记本上导入imblearn python包时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows上安装了 https://github.com/glemaitre/imbalanced-learn 使用pip installcondagithub的powershell.但是当我在iPython笔记本上时,我尝试使用以下命令导入包:

I installed https://github.com/glemaitre/imbalanced-learn on windows powershell using pip install, conda and github. But when I'm on iPython notebook and I tried to import the package using:

from unbalanced_dataset import UnderSampler, OverSampler, SMOTE

我得到了错误:

ImportError  Traceback (most recent call last) <ipython-input-9-ad6fd7440a05> in <module>()
----> 1 from imbalanced_learn import UnderSampler, OverSampler, SMOTE

ImportError: No module named imbalanced_learn

使用Windows for Python的新手,是否必须将软件包安装在某个文件夹中?

New to using windows for Python, do I have to install the package in some folder?

推荐答案

如果它不起作用,则可能需要安装"imblearn"软件包.

If it don't work, maybe you need to install "imblearn" package.

尝试安装:

  • 点:pip install -U imbalanced-learn
  • anaconda:conda install -c glemaitre imbalanced-learn
  • pip: pip install -U imbalanced-learn
  • anaconda: conda install -c glemaitre imbalanced-learn

然后尝试将库导入文件:

Then try to import library in your file:

  • from imblearn.over_sampling import SMOTE

这篇关于在ipython笔记本上导入imblearn python包时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 19:05