错误信息1:SyntaxError:invalid syntax--无效语法

解决办法:变量名不能使用关键字如下图:

错误信息2:TypeError:'str' object is not callable--字符串对象不是可以输出的

解决办法:不建议使用Python内置方法为变量名、print这个函数的名字给覆盖、使用print的时候找到的是自己定义的值

错误信息3:TypeError: Can't convert 'int' object to str implicitly--类型错误无法隐式将“int”对象转换为str(环境是Python3.5版本)

解决办法:用int转下str字符串类型

错误信息4:TypeError: must be str, not int--类型错误必须是字符串不能是整型(Python3.6版本)

解决办法:用int转下str字符串类型

错误信息5:TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'--类型错误int()参数必须是字符串、类似对象的字节或数字,而不是'nonet'

解决办法:

错误信息6:TypeError: %d format: a number is required, not str--类型错误、格式需要数字而不是字符串

解决办法:字符串前面加int

错误信息6:TypeError: not enough arguments for format string--typeerror:格式字符串的参数不足

解决办法:增加缺少占位的参数。

错误信息7:TypeError: not all arguments converted during string formatting--typeerror:不是所有在字符串格式化期间转换的参数

解决办法:参数过多了要去掉。

错误信息8:'tuple' object doesn't support item deletion--“tuple”对象不支持项删除

错误信息9:RuntimeError: dictionary changed size during iteration--运行时错误:字典在迭代期间更改了大小

错误信息10:RuntimeError: Set changed size during iteration--运行时错误:在迭代期间设置更改的大小。

错误信息11:IndentationError: expected an indented block--缩进错误:需要缩进的块

错误信息12:TypeError: write() argument must be str, not int--typeerror:write()参数必须是str,而不是int

错误信息13:IndentationError: unexpected indent--缩进错误:意外缩进。

错误信息14:TypeError: list indices must be integers or slices, not str--列表的索引必须是整数或切片、而不是str

错误信息15:NameError: name 's' is not defined--名称错误:名称不是定义。

错误信息16:SyntaxError: keyword argument repeated--语法错误:关键字参数重复

错误信息17:TypeError: 'a1' is an invalid keyword argument for this function--类型错误:'a1'是此函数的无效关键字参数

错误信息18:TypeError: 'int' object is not callable--类型错误:int对象不可调用。

错误信息19:TypeError: 'int' object is not callable--类型错误、int对象不可调用

错误信息20:IndentationError: unexpected indent--缩进错误、意外缩进

错误信息21:UnboundLocalError: local variable 'name' referenced before assignment--取消绑定本地错误、赋值前引用的局部变量"name"

错误信息22:SyntaxError: no binding for nonlocal 'a' found--语法错误、未找到非本地a的绑定

解决办法:nonlocal不能放在global下面

错误信息23:TypeError: <lambda>() missing 1 required positional argument: 'i'--类型错误、lambda缺少一个必须的位置参数

解决办法:em里面增加值

错误信息24:TypeError: list indices must be integers or slices, not str--类型错误:列表索引必须是整数或切片,而不是str

错误信息25:ValueError: too many values to unpack (expected 2)--值错误:要解包的值太多(应为2)

错误信息26:TypeError: 'type' object is not subscriptable--typeerror:“type”对象不可订阅

错误信息27:TypeError: run_time() missing 1 required positional argument: 'f'--typeerror:run_time()缺少1个必需的位置参数:“f”

错误信息28:TypeError: '<' not supported between instances of 'dict' and 'dict'--类型错误:“dict”和“dict”的实例之间不支持“<”

错误信息29:TypeError: 'generator' object is not subscriptable--typeerror:“generator”对象不可订阅

错误信息30:TypeError: unsupported operand type(s) for +: 'function' and 'str'--typeerror:不支持+的操作数类型:“function”和“str”

错误信息31:RecursionError: maximum recursion depth exceeded while calling a Python object--递归错误:调用Python对象时,最大递归深度超过了

  [Previous line repeated 993 more times]--[上一行重复993次]

错误信息32:SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape--syntaxerror:(unicode错误)“unicode escape”编解码器无法解码位置2-3中的字节:截断的\uxxx escape

错误信息33:ModuleNotFoundError: No module named 'lib'--moduleNotFounderror:没有名为“lib”的模块、循环导入报错

错误信息34:AttributeError: module 'core.src' has no attribute 'login_dic'--属性错误:attributeerror:模块'core.src'没有'login dic'属性

错误信息35:ValueError: not enough values to unpack (expected 2, got 1)--值错误:没有足够的值来解包(应为2,得到1)

错误信息36:

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard page generated by the handler for this status code.--您看到这个错误是因为您的Django设置文件中有DEBUG=True。将其更改为False,Django将显示处理程序为此状态代码生成的标准页。

解决:selenium.common.exceptions.WebDriverException: Message: 'chromedriver' execu

解决办法:
安装与浏览器版本匹配的webdriver
1、打开谷歌浏览器, 在地址栏输入 chrome://version/ 查看版本信息:

2、选择合适版本的驱动下载,
下载地址:http://chromedriver.storage.googleapis.com/index.html

3.解压下载的驱动放到指定目录,代码调用时指定该目录即可。
解压后的目录:

将chromedriver.exe 放入安装的selenium库下

运行的程序如下:

from selenium import webdriver
chrome_driver=r"D:\Python\Anaconda\Lib\site-packages\selenium\webdriver\chrome\chromedriver.exe"
driver=webdriver.Chrome(executable_path=chrome_driver)
1
2
3

运行成功!!!!!!

Python27期:错误宝典的更多相关文章

  1. python27期day12:推导式、内置函数、高阶函数、匿名函数、作业题

    1.推导式:做一些有规律的数据结构 列表推导式: 普通循环模式: [加工后的变量 for 循环] 示例一:print([i for i in range(1,51)]) 结果:[1, 2, 3, 4, ...

  2. python27期尚哥讲TCP:

    TCP:传输控制协议(使用情况多于udp) 稳定:保证数据一定能收到 相对UDP会慢一点 web服务器一般都使用TCP(银行转账,稳定比快要重要)TCP通信模型: 在通信之前,必须先等待建立链接 TC ...

  3. python27期尚哥讲并发编程:

    python27day23并发编程----------------------------------------------------------------------------------- ...

  4. python27期day19:面向对象

    1.class GirlFriend(object): #定义女朋友类: eyes = 2 #类属性(静态属性),是属于当前类的 #当前类的所有对象,所共有的特征 sex = "女" ...

  5. python27期day17:re、logging日志模块、作业。

    1.re: 正则就是用一些具有特殊含义的符号组合到一起(称为正则表达式)来描述字符或者字符串的方法.或者说:正则就是用来描述一类事物的规则.(在Python中)它内嵌在Python中,并通过 re 模 ...

  6. python27期day16:序列化、json、pickle、hashlib、collections、软件开发规范、作业。

    序列化模块:什么是序列化呢? 序列化的本质就是将一种数据结构(如字典.列表)等转换成一个特殊的序列(字符串或者bytes)的过程就叫做序列化.将这个字典直接写入文件是不可以的,必须转化成字符串的形式, ...

  7. python27期day14:有参装饰器、多个装饰器装饰一个函数、递归、作业题

    1.有参装饰器:给装饰器添加一个参数.来控制装饰器的行为. @auth(参数) auth里层的函数名 = auth(参数) 被装饰的函数名 = auth里层的函数名(被装饰的函数名) 被装饰的函数名( ...

  8. python27期day11:f-strings格式化、迭代器、生成器、作业题。

    1.建议小写f: name = "宝元"age = 18sex = "男"msg = F"姓名:{name},性别:{age},年龄:{sex}&qu ...

  9. python27期day10:函数的动态参数、函数的注释、函数的名称空间、函数的嵌套、global(修改全局的)、nonlocal(修改局部的)、函数名的第一类对象及使用、作业题。

    1.动态参数的作用: 能够接收不固定长度参数 位置参数过多时可以使用动态参数 * args是程序员之间约定俗称(可以更换但是不建议更换) * args获取的是一个元组 ** kwargs获取的是一个字 ...

随机推荐

  1. CF798D Mike and distribution

    CF798D Mike and distribution 洛谷评测传送门 题目描述 Mike has always been thinking about the harshness of socia ...

  2. Unity 插件宝典 (张忠喜 廖一庭 著)

    第1章 模型类插件 第2章 特效类插件 第3章 动画插件 第4章 编辑器插件 第5章 脚本类插件 第6章 GUI插件 第7章 Shaders插件 第8章 优化类插件 第9章 综合应用----卡通版赛车 ...

  3. 算法八字符串转换正数(atoi)

    请你来实现一个 atoi 函数,使其能将字符串转换成整数. 首先,该函数会根据需要丢弃无用的开头空格字符,直到寻找到第一个非空格的字符为止. 当我们寻找到的第一个非空字符为正或者负号时,则将该符号与之 ...

  4. Debug 路漫漫-14:Python: AttributeError: module 'tensorflow' has no attribute 'sub'

    在调试 <Neural Factorization Machines for Sparse Predictive Analytics>论文的源码(https://github.com/he ...

  5. 从游击队到正规军:马蜂窝旅游网的IM系统架构演进之路

    本文引用自马蜂窝公众号,由马蜂窝技术团队原创分享. 一.引言 今天,越来越多的用户被马蜂窝持续积累的笔记.攻略.嗡嗡等优质的分享内容所吸引,在这里激发了去旅行的热情,同时也拉动了马蜂窝交易的增长.在帮 ...

  6. 【linux】glibc升级

    glibc升级 步骤如下: 1.下载解压glibc wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz tar zxvf glibc-2.18.ta ...

  7. h5py报错:FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.

    导入h5py的时候,报错: /home/harris/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: ...

  8. 在 .NET Core 中使用异步的 ADO.NET 的简单示例

    直接贴代码: Program.cs using Microsoft.Extensions.Configuration; using System; using System.Data; using S ...

  9. Nginx自建SSL证书部署HTTPS网站

    一.创建SSL相关证书 1.安装Nginx(这里为了测试使用yum安装,实际看具体情况) [root@localhost ~]# yum install nginx -y #默认yum安装已经支持SS ...

  10. MySQL for OPS 02:SQL 基础

    写在前面的话 上一节主要谈谈 MySQL 是怎么安装的以及最简单的初始化我们应该做哪些配置.其中也用到了一些简单的用户操作 SQL,所以这一节主要学习常用的 SQL 使用. SQL 介绍 在了解 SQ ...