错误信息如下:

原因是FileNotFoundError是python3.0中的写法,而Python2.7中应写为IOError。

Python2.7错误处理FileNotFoundError报错NameError: name 'FileNotFoundError' is not defined的更多相关文章

  1. 报错NameError: name ‘null’ is not defined的解决方法

    报错NameError: name 'null' is not defined的解决方法 eval()介绍 eval()函数十分强大,官方demo解释为:将字符串str当成有效的表达式来求值并返回计算 ...

  2. python2执行程序报错:NameError: name 'y' is not defined

    然后运行一直报错 这个错误,是由于版本不同造成的语法错误,在python3中,输入可以使用input,但如果你的版本是python2,那么此时input就得改成raw_input,否则你输入数据会被当 ...

  3. py+selenium 报错NameError: name 'NoSuchElementException' is not defined【已解决】

     报错:NameError: name 'NoSuchElementException' is not defined  如图 解决方法: 头部加一句:from selenium.common.exc ...

  4. Python,报错NameError: name 'math' is not defined

    1 #-*- coding : utf-8 -*- 2 import math 3 4 def move(x, y, step, angle=0): 5 nx = x + step * math.co ...

  5. [报错]-NameError: name 'NAN' is not defined

    部分数据输出为NaN,处理这部分异常数据使用isnan()函数 from math import isnan isnan(z) 参考: https://www.cnblogs.com/itdyb/p/ ...

  6. 两个由于php.ini配置错误导致的报错:ajax图片上传报错和exec报错

    遇到了两个由于php.ini配置错误导致的报错:ajax图片上传报错和exec报错 首先第一个: 在做一个用ajax图片上传的功能中,php报了这样一个错误:File upload error - u ...

  7. python2.7 安装pycrypto库报错

    windows + python2.7 先安装VC包 https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59 ...

  8. jQuery报错:Uncaught ReferenceError: $ is not defined

    在使用jQuery的时候,发现有如下报错: Uncaught ReferenceError: $ is not defined  (anonymous function) 出现这个报错的原因: 1.j ...

  9. 报错:The valid characters are defined in RFC 7230 and RFC 3986

    访问 spring boot controller时,报错:The valid characters are defined in RFC 7230 and RFC 3986 1.特殊符号 @Spri ...

随机推荐

  1. Opencv笔记(一):图像的基本操作

    1.图像的读.显示和保存操作 import cv2 img = cv2.imread('filename',0); cv2.imshow('name',img); k=cv2.waitKey(0); ...

  2. C# 元组

    Tuple<,); Console.WriteLine(t.Item1); Console.WriteLine(t.Item2); C#7 可以使用圆括号声明一个元组: (); Console. ...

  3. logService

    vpackage org.linlinjava.litemall.admin.service; import org.apache.shiro.SecurityUtils; import org.ap ...

  4. SMTP错误码/建议解决方法

    SMTP错误码/建议解决方法 错误总表 420 1. Timeout Communication Problem Encountered During Transmission. Thie Is a ...

  5. Redis实现分布式读写锁(Java基于Lua实现)

    https://blog.csdn.net/grandachn/article/details/89032815 https://blog.csdn.net/xingsilong/article/de ...

  6. LeetCode No.82,83,84

    No.82 DeleteDuplicates 删除排序链表中的重复元素 II 题目 给定一个排序链表,删除所有含有重复数字的节点,只保留原始链表中 没有重复出现 的数字. 示例 输入: 1->2 ...

  7. Redis实现高并发分布式锁

    分布式锁场景在分布式环境下多个操作需要以原子的方式执行首先启一个springboot项目,再引入redis依赖包: <!-- https://mvnrepository.com/artifa . ...

  8. 93)PHP,session代码练习

    (1)开启session Session_start(): (2)session值的设定: <?php session_start(); $_SESSION['name']='xiaohua'; ...

  9. Mac系统常用软件

    1.往移动硬盘中拷贝东西.创建文件夹: Mounty 2.解压缩软件(rar): the unarchiver 3.类似Xshell软件: FinalShell(国产) 输入以下命令: curl -o ...

  10. chop|divorce|harsh|mutual|compel|

    这个英音很special VERB 砍;剁;劈;切If you chop something, you cut it into pieces with strong downward movement ...