今天在读入文件时老是报错 OSError: [Errno 22] Invalid argument

方法一:
将路径中的\改为/或者\\。这是因为Python中\t为换行符,而无法识别。

方法二:
手打一遍路径,不要直接复制粘贴。像pycharm,Spyder等平台,复制黏贴路径都会报错“OSError: [Errno 22] Invalid argument:“.

reference:
https://blog.csdn.net/kehuizhidao/article/details/80393189
https://blog.csdn.net/CSDN_Xying/article/details/97927376

成功解决Python报错: OSError: [Errno 22] Invalid argument相关推荐

  1. python中遇到报错OSError: [Errno 22] Invalid argument的解决方法

    将时间戳用python语言转换成指定日期: 代码如下: import timetimeStamp = 1589018284000 timeArray = time.localtime(timeStam ...

  2. pyLDAvis3.3.1 报错 OSError: [Errno 22] Invalid argument: ‘https://cdn.jsdelivr.net/gh/bmabey/pyLDAvis@

    问题描述: pyLDAvis3.3.1 报错: File "E:\ProgramData\Anaconda3\lib\site-packages\pyLDAvis_display.py&qu ...

  3. 报错OSError: [Errno 22] Invalid argument 的一种解决方法

    今天写作业的时候突然读不了txt文件了,查了很多地方,已开始写相对路径之后显示的是如下报错,仔细检查之后并没有发现代码问题. 查找资料仔细检查之后依旧无法解决,决定改用写绝对路径. 填写绝对路径时又报 ...

  4. pytorch数据加载时报错OSError: [Errno 22] Invalid argument

    将数据加载器的num_workers删去,即由 train_loader = torch.utils.data.DataLoader(trainset, batch_size=batch_size, ...

  5. OSError: [Errno 22] Invalid argument:**

    OSError: [Errno 22] Invalid argument: 在使用open打开文件时,出现报错 OSError: [Errno 22] Invalid argument: 'H:\\G ...

  6. Python OSError: [Errno 22] Invalid argument:的出现和解决

    1.在学习从文件读取数据中,写了个示例代码,读取不在同一个目录的file.txt,运行后报这个Python OSError: [Errno 22] Invalid argument:错误: (1).首 ...

  7. 对于解决python中出现的OSError: [Errno 22] Invalid argument: ‘\u202aD‘ 的解决

    对于解决python中出现的OSError: [Errno 22] Invalid argument: '\u202aD' 的解决 ** 今天这导入数据集文件时有时正常运行,有时出现了OSError: ...

  8. 【报错】“OSError: [Errno 22] Invalid argument: ‘cache\\resume_lattice_only_tra”

    [报错]"OSError: [Errno 22] Invalid argument: 'cache\resume_lattice_only_train:" Windows上运行Fl ...

  9. flask 项目启动报错:OSError OSError: [Errno 22] Invalid argument

    flask 项目启动报错:OSError OSError: [Errno 22] Invalid argument 问题描述-OSError OSError: [Errno 22] Invalid a ...

最新文章

  1. DHCP之一 DHCP的部署安装
  2. 【Android NDK 开发】NDK 交叉编译 ( Ubuntu 中交叉编译动态库 | Android Studio 中配置使用第三方动态库 )
  3. php imagefill,PHP 图像填充 imagefill、imagefilledarc 与 imagefilledrectangle() 函数
  4. 循环神经网络应用案例
  5. 比较两个title是否相等(差点把我送走)
  6. java开发人员_每个Java开发人员都应该阅读的10本书
  7. [渝粤教育] 广东-国家-开放大学 21秋期末考试财政学10573k1
  8. NB模组基本AT指令
  9. 《ArcGIS Runtime SDK for Android开发笔记》——(9)、空间数据的容器-地图MapView
  10. 为何要搞 10 年?方舟编译器专家首次回应
  11. Windows API ——GetLogicalDriveStrings——获取逻辑驱动器
  12. 【模板】左偏树(可并堆)
  13. Atitit 数据类型体系图 目录 1. 系统常用的数据类型 1 2. H5 form表单新数据类型 2 2.1. TML5 新的 Input 类型 2 2.2. HTML5 的新的表单元素: 2
  14. jquery下的this,$(this),$(this).get(0);
  15. Matlab求解点到直线距离
  16. 小象学院 零基础Python入门 案例四 52周存钱挑战v_4.0
  17. tp5 mysql悲观锁_thinkphp悲观锁机制处理高并发
  18. MySQL数据库实验练习题
  19. JUC并发编程学习笔记
  20. CM108AH和DP108/DP108T的区别

热门文章

  1. Dynamics CRM2013 用户进入系统所必需的那些权限
  2. AE中将图层作为蒙版使用
  3. supermicro服务器通过U盘安装部署vmware vsphere并使用
  4. 102.【Redis】
  5. 一个父亲的智慧:孩子教不好,别总怨社会
  6. C#winform 自定义模仿MessageBox的对话框
  7. mysql中为表增加外键_如何在Excel 2013中为符号分配键盘快捷键
  8. 手机在未知密码的情况如何获取手机型号或版本号
  9. MyBioSource抗体:Rabbit eIF2alpha 多克隆抗体方案
  10. iPhone 7-b