博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python workspace_python报错汇总
阅读量:5300 次
发布时间:2019-06-14

本文共 3041 字,大约阅读时间需要 10 分钟。

一、can only concatenate str (not "Tag") to str

报错信息:Exception has occurred: TypeError

can only concatenate str (not "Tag") to str

File "F:\python_workspace\customs\extract.py", line 140, in containerInfo

item['\'' + titles[j] + '\''] = contents[i]

File "F:\python_workspace\customs\extract.py", line 59, in parseWeb

container_1_item = Extract.containerInfo(str(items[5]), str(titles[5]), myDb, url_id, county)

File "F:\python_workspace\customs\detail.py", line 78, in openTab

tarGetData = Extract.parseWeb(page, url_id)

File "F:\python_workspace\customs\detail.py", line 40, in callUpBrowser

self.openTab(driver, tarGetData)

File "F:\python_workspace\customs\detail.py", line 83, in

detail.callUpBrowser()

解决方案

二维数组的KEY中含有html标签

二、Value 'item_total.append' is unsubscriptable

报错信息:item_total.append[item]

-------------------------------

item_total: list

Value 'item_total.append' is unsubscriptablepylint(unsubscriptable-object)

解决方案

item_total.append[item]改为item_total.append(item)

三、can only concatenate str (not "NoneType") to str

报错信息:Exception has occurred: TypeError

can only concatenate str (not "NoneType") to str

File "F:\python_workspace\customs\extract.py", line 150, in containerInfo

item['\'' + titles[j].string + '\''] = contents[i].string

File "F:\python_workspace\customs\extract.py", line 66, in parseWeb

Extract.containerInfo(str(items[7]), str(titles[7]), myDb, url_id, county, 3)

File "F:\python_workspace\customs\detail.py", line 78, in openTab

tarGetData = Extract.parseWeb(page, url_id)

File "F:\python_workspace\customs\detail.py", line 40, in callUpBrowser

self.openTab(driver, tarGetData)

File "F:\python_workspace\customs\detail.py", line 83, in

detail.callUpBrowser()

解决方案

对处理的字符串做判断if string is None

四、Unable to add the Win32_PerfRawData_PerfDisk_PhysicalDisk enum

报错信息:[6668:6348:0625/111147.071:ERROR:wmi_refresher.cc(150)] Unable to add the Win32_PerfRawData_PerfDisk_PhysicalDisk enum.

解决方案加大time.sleep(5) 时间到一个合适的值

五、FutureWarning: Using an implicitly registered datetime converter for a matplotlib plotting method. The converter was registered by pandas on import. Future versions of pandas will require you to explicitly register matplotlib converters.

报错信息:FutureWarning: Using an implicitly registered datetime converter for a matplotlib plotting method. The converter was registered by pandas on import. Future versions of pandas will require you to explicitly register matplotlib converters.

To register the converters:

>>> from pandas.plotting import register_matplotlib_converters

>>> register_matplotlib_converters()

warnings.warn(msg, FutureWarning)

解决方案

添加报错信息中的代码from pandas.plotting import register_matplotlib_converters

register_matplotlib_converters()

六:Unable to open 'parsers.pyx': Unable to read file

报错信息:Unable to open 'parsers.pyx': Unable to read file (Error: File not found (f:\python_workspace\pandas-example\pandas\_libs\parsers.pyx)).

解决方案**文件路径错误**

七:RuntimeError: already started

报错信息:raise RuntimeError('already started')

RuntimeError: already started

解决方案

vscode的问题,在终端或者命令行执行即可

转载地址:http://madqv.baihongyu.com/

你可能感兴趣的文章
1.7-BGP③
查看>>
第3章 ES文档和故障处理
查看>>
jquery实现返回基部案例效果
查看>>
oracle 电子商务解决方案讲义
查看>>
屏幕录制H.264视频,AAC音频,MP4复,LibRTMP现场活动
查看>>
padding与margin的差别
查看>>
RDD的依赖关系
查看>>
类型"Microsoft.Office.Interop.Word.ApplicationClass"未定义构造函数
查看>>
Android简易实战教程--第二十九话《创建图片副本》
查看>>
Android简易实战教程--第三十二话《使用Lrucache和NetworkImageView加载图片》
查看>>
Oracle 11g Articles
查看>>
Android直接用手机打包apk!
查看>>
vue中created、mounted等方法整理
查看>>
如何连接oracle数据库及故障解决办法
查看>>
如何给ocx,dll控件进行数字签名
查看>>
新开通博客【人工置顶】
查看>>
mongoose学习参考
查看>>
python 输入列的名字,直接可以得到图像
查看>>
ztree根据关键字模糊搜索
查看>>
求一个环形数组最大子数组的和
查看>>