![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python报错处理
能变瘦的莫巧丽
别人都在努力,你为什么不努力!
展开
-
出现cannot import name ‘Imputer‘ from ‘sklearn.preprocessing报错问题
python中sklearn导入Imputer模块报错原创 2022-06-05 17:10:36 · 3982 阅读 · 0 评论 -
pyecharts保存图片时出现:WebDriverException: ‘chromedriver‘ executable needs to be in PATH. Please see 问题
当对pyecharts结果进行使用snapshot_selenium模块保存成图片时,发生如下报错问题:WebDriverException: ‘chromedriver’ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home主要的原因是驱动问题,这里很简单,只需要把谷歌驱动器放到运行代码的路径下面即可,根据自己谷歌浏览器的版本下载x相应版本。如下图所示:原创 2022-05-30 16:45:25 · 334 阅读 · 0 评论 -
安装pyecharts出现 ImportError: cannot import name ‘Bar3D‘ from ‘pyecharts‘ (E:\anaconda\lib\site-package
安装pyecharts时,使用pip install pyecharts安装,显示安装成功了,但是在python中导入模块的时候出现,如下错误:打开报错路径,发现__init__.py文件下面只有两行代码,其余的为空,因此有以下两种方法。方法一:将下面的代码复制到__init__.py文件下:from ..charts.basic_charts.bar import Barfrom ..charts.basic_charts.bmap import BMapfrom ..charts.basi原创 2022-05-28 13:25:35 · 1060 阅读 · 0 评论 -
使用pandas读取xlsx文件时报错:xlrd.biffh.XLRDError: Excel xlsx file; not supported
运行环境为Pycharm 2022~下,读取xlsx文件出现如下问题:主要与安装xlrd的版本问题有关,这里可以直接安装其旧版本,使用如下命令即可解决pip install xlrd==1.2.0 -i https://pypi.douban.com/simple原创 2022-05-24 11:41:22 · 998 阅读 · 0 评论 -
在Python中安装了graphvize还出现报错:ExecutableNotFound: failed to execute ‘dot‘, make sure the Graphviz execut
出现这种情况,通常是由于环境变量没有配置好.这里是在使用Pycharm中遇到的.安装在安装graphviz包的时候,除了线上安装,还要线下进行安装1.首先第一步先进行线下安装,去官网上下载其安装包,相关提取链接如下:链接:https://pan.baidu.com/s/1u6YkS_T3wnYPk78HkcK8Qg?pwd=1023 提取码:1023 --来自百度网盘超级会员V2的分享点击安装,可以选择将安装包的路径添加到系统变量当中,这时候就会自动帮我们添加到系统环境变量中,安装完成后,原创 2022-05-20 10:13:17 · 3525 阅读 · 0 评论 -
安装imblearn模块
安装imblearn模块可以使用如下命令:pip install imblanced-learn -i https://pypi.douban.com/simple但是有可能会出现版本问题或其他bug,建议指定安装版本为0.6.0,本例使用的Python版本为3.7修改命令为:pip install imblanced-learn --user -i https://pypi.douban.com/simple...原创 2022-05-19 11:18:19 · 5245 阅读 · 5 评论 -
当Mongodb插入数据出现TypeError: ‘Collection‘ object is not callable.。。。。。
当Mongodb插入数据出现TypeError: ‘Collection’ object is not callable. If you meant to call the ‘insert’ method on a ‘Collection’ object it is failing because no such method exists.错误时只需要把insert改为inster_many即可解决问题...原创 2022-05-19 00:06:03 · 1224 阅读 · 0 评论 -
解决Mongodb出现Error connecting to localhost272017......错误
当Mongodb出现如下错误Error connecting to localhost272017…表示没有连接到服务,只需要在任务资源管理器,打开服务,找到Mongodb启动服务,再次打开Mongodb即可解决。原创 2022-05-18 23:55:07 · 1448 阅读 · 0 评论 -
SVM 出现TypeError: must be real number, not str
SVM 训练时出现TypeError: must be real number, not str错误相关代码为:model_svr=SVR(gamma=‘scale’)这里只需要将scale改为如下命令即可:model_svr=SVR(gamma=‘auto’)原创 2022-05-17 10:51:29 · 1540 阅读 · 1 评论