解决TypeError: __init__() got an unexpected keyword argument ‘cachedir‘问题

在使用Python进行机器学习时遇到TypeError: __init__() got an unexpected keyword argument 'cachedir',通过查找并修改Anaconda安装路径下mglearn库的plot_pca.py文件,成功解决问题。参考了相关博客分享的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

碰到这个问题,网上看的解决方法云里雾里没成功,尝试去跟注释改代码,没想到成功了,分享给大家

import mglearn

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-26a0454c3f6e> in <module>
----> 1 import mglearn

D:\Anaconda3\lib\site-packages\mglearn\__init__.py in <module>
----> 1 from . import plots
      2 from . import tools
      3 from .plots import cm3, cm2
      4 from .tools import discrete_scatter
      5 from .plot_helpers import ReBl

D:\Anaconda3\lib\site-packages\mglearn\plots.py in <module>
     12 from .plot_tree_nonmonotonous import plot_tree_not_monotone
     13 from .plot_scaling import plot_scaling
---> 14 from .plot_pca import plot_pca_illustration, plot_pca_whitening, plot_pca_faces
     15 from .plot_decomposition import plot_decomposition
     16 from .plot_nmf import plot_nmf_illustration, plot_nmf_faces

D:\Anaconda3\
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值