错误信息如下:

原因是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. split - 拆分文件

    拆分文件 # 每个文件的行数为1000行 split -l 1000 test.txt # 将test文件拆分,20M一个文件 split -b 20M test.txt test文件拆分,并且文件名 ...

  2. JdbcRDD连接MySQL

    (1)添加依赖 <dependencies> <dependency> <groupId>org.apache.spark</groupId> < ...

  3. tesseract系列(3) -- tesseract训练

    tessract的训练有个工具叫 jTessBoxEditor 1.jTessBoxEditor是用java写的,首先要装java的环境 jdk-8u191-windows-x64.exe 这个我想从 ...

  4. MFC的combox禁止键盘输入

    项目中有个combox的下拉窗控件,鼠标双击总能存在焦点,并且会修改combox显示的文字,网上查了好多资料,都说修改style,可是我的vs2015里没发现有style的属性,后面修改 modal ...

  5. 感叹号在Linux bash中使用技巧

    1. 重复执行上一条指令  !! [root@iZ23t6nzr7dZ python]# ls /usr/local/ aegis bin etc games include lib lib64 li ...

  6. Ubuntu虚拟环境的搭建

    转载:https://blog.csdn.net/weixin_43078957/article/details/86006240 虚拟环境的搭建1.pip install virtualenv这个要 ...

  7. python中读取mat文件

    mat数据格式是Matlab的数据存储的标准格式 在python中可以使用scipy.io中的函数loadmat()读取mat文件. import scipy.io as scio path = 'e ...

  8. Java为什么能够跨平台?

    首先介绍一下Java的各个层级,先放一张图: 硬件,操作系统和操作系统接口:这三级不说大家都知道,操作系统有很多种,比如Windows,Linux.Windows又分为win7,win10,win x ...

  9. Qt QThread必须要了解的几个函数

    概述 如果想对Qt中的QThread有个更加深刻的了解,必须要知道这几个重要的函数,现在就一一介绍下. 函数介绍 属性 返回值 函数体 功能 static QThread * QThread::cur ...

  10. keras使用、函数功能

    #1. keras.engine.input_layer.Input() def Input(shape=None, batch_shape=None,   name=None, dtype=None ...