gpt4 book ai didi

python - 导入错误: cannot import name 'makedirs'

转载 作者:行者123 更新时间:2023-12-01 06:27:46 26 4
gpt4 key购买 nike

我尝试在 Google Colab 中导入数据(如下所示)

from imblearn.datasets import make_imbalance

但是我得到的输出是:

/usr/local/lib/python3.6/dist-packages/sklearn/externals/six.py:31: FutureWarning: The module is deprecated in version 0.21 and will be removed in version 0.23 since we've dropped support for Python 2.7. Please rely on the official version of six (https://pypi.org/project/six/).
"(https://pypi.org/project/six/).", FutureWarning)
/usr/local/lib/python3.6/dist-packages/sklearn/utils/deprecation.py:144: FutureWarning: The sklearn.neighbors.base module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.neighbors. Anything that cannot be imported from sklearn.neighbors is now part of the private API.
warnings.warn(message, FutureWarning)
/usr/local/lib/python3.6/dist-packages/sklearn/utils/deprecation.py:144: FutureWarning: The sklearn.datasets.base module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.datasets. Anything that cannot be imported from sklearn.datasets is now part of the private API.
warnings.warn(message, FutureWarning)
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-5e38d91da46a> in <module>()
----> 1 from imblearn.datasets import make_imbalance

1 frames
/usr/local/lib/python3.6/dist-packages/imblearn/datasets/_zenodo.py in <module>()
58 from sklearn.datasets import get_data_home
59 from sklearn.datasets.base import Bunch
---> 60 from sklearn.utils.fixes import makedirs
61 from sklearn.externals import six
62 from sklearn.utils import check_random_state

ImportError: cannot import name 'makedirs'

我已经尝试用谷歌搜索这个问题 30 分钟,但没有取得任何进展。谁能帮我吗?

最佳答案

我已经找到修复方法了。只需这样做:

pip install -U imbalanced-learn

一切都会顺利进行。

关于python - 导入错误: cannot import name 'makedirs' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60051343/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com