FileNotFoundError: [WinError 2] 系统找不到指定的文件
用Idle运行Python脚本的时候发现如下错误:
Traceback (most recent call last):
File "D:\Python\Python36-32\lib\site-packages\selenium-3.4.3-py3.6.egg\selenium\webdriver\common\service.py", line 74, in start
stdout=self.log_file, stderr=self.log_file)
File "D:\Python\Python36-32\lib\subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "D:\Python\Python36-32\lib\subprocess.py", line 990, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
后来在stackoverflow上找到如下解决办法:
In Windows , to use echo in subprocess, you would need to use shell=True . This is because echo is not a separate executable, but rather a built-in command for the windows command line. Example -
在windows 在子进程中使用echo,需要设置 shell =True,因为 echo 不是单独的命令,而是window CMD 内置的命令
process1 = subprocess.Popen(command1,stdout=subprocess.PIPE,shell=True)
Also, please do note, you should only use shell=True when absolutely necessary (as in this case , to use echo in windows in subprocess).
并且,需要注意,只有在绝对需要的情况下才使用shell=True
找到 subprocess.py脚本,将对应行加上shell=true 参数。
FileNotFoundError: [WinError 2] 系统找不到指定的文件的更多相关文章
- python FileNotFoundError: [WinError 2] 系统找不到指定的文件。
D:\Test\TestSWP\Scripts\python.exe D:/Test/SWP/TestSWP/chorme/chorme.pyTraceback (most recent call l ...
- 路径不对 导致FileNotFoundError: [WinError 2] 系统找不到指定的文件, 问题解决办法
执行python + selenium 代码 from selenium import webdriver driver = webdriver.Chrome("D:\AutoConf\bi ...
- 在使用selenium时出现FileNotFoundError: [WinError 2] 系统找不到指定的文件。
今天在使用selenium出现这样的错: Traceback (most recent call last): File "E:\python\lib\site-packages\selen ...
- FileNotFoundError: [WinError 2] 系统找不到指定的文件。 解决方案
用Idle运行Python脚本的时候发现如下错误: Traceback (most recent call last): File "C:\Users\DangKai\Desktop\pyt ...
- pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your path && FileNotFoundError: [WinError 2] 系统找不到指定的文件。
C:\Users\k\Desktop\test>python test.py Traceback (most recent call last): File , in run_tesseract ...
- 转换文件格式遭遇 FileNotFoundError:[WinError 2]系统找不到指定的文件
重启试试
- TextClip构造方法报OSError:MoviePy creation of None failed because of the following [WinError 2]系统找不到指定的文件
☞ ░ 前往老猿Python博文目录 ░ 在使用moviepy的构造方法创建实例时报错: "C:\Program Files\Python37\python.exe" F:/stu ...
- [Python学习]错误篇二:切换当前工作目录时出错——FileNotFoundError: [WinError 3] 系统找不到指定的路径
REFERENCE:<Head First Python> ID:我的第二篇[Python学习] BIRTHDAY:2019.7.13 EXPERIENCE_SHARING:解决切换当前工 ...
- building '_mysql' extension error: [WinError 2] 系统找不到指定的文件。
D:\4yanjiiu\APIzidong\MySQL-python-1.2.5>py running install running bdist_egg running egg_info wr ...
随机推荐
- git push报错大文件,删除后重新commit依然报错
git push报错: github不能上传大文件,按道理删掉重新提交就行了 可是删掉后,git add -A,再git commit,再git push,依然报错 后来我想明白了 github上传时 ...
- centos 下yum lock的解决办法
centos 下yum lock的解决办法 centos7下yum install的时候,报了一堆错误,如下: Another app is currently holding the yum loc ...
- 什么是神经网络 (Neural Network)
反向传播: 可以看作是再一次将传过来的信号传回去, 看看这个负责传递信号神经元对于”讨糖”的动作到底有没有贡献, 让它好好反思与改正, 争取下次做出更好的贡献. 生物神经网络和人工神经网络的差别: 人 ...
- 深入浅出ES6的标准内置对象Proxy
Proxy是ES6规范定义的标准内置对象,可以对目标对象的读取.函数调用等操作进行拦截.一般来说,通过Proxy可以让目标对象"可控",比如是否能调用对象的某个方法,能否往对象添加 ...
- phpqrcode生成任意尺寸的二维码
在Thinkphp中整合phpqrcode用于生成二维码,其代码如下: vendor("phpqrcode.phpqrcode"); QRcode::png('http://www ...
- 洛谷$P3756\ [CQOI2017]$老$C$的方块 网络流
正解:网络流 解题报告: 传送门$QwQ$ 看到不能出现给定的讨厌的图形,简单来说就,特殊边两侧的方格不能同时再连方格. 所以如果出现,就相当于是四种方案?就分别炸四个格子. 然后冷静分析一波之后发现 ...
- 小小知识点(四十九)——SCMA
SCMA的实现基于两步: 1.实现码本资源到物理频域资源映射的映射矩阵(matrix mapping): 2.实现二进制比特流到码本映射的复数域星座图(complex domain constella ...
- 侠说java8-行为参数化(开山篇)
啥是行为参数化 行为参数化的本质是不执行复杂的代码块,让逻辑清晰可用. 相信使用过js的你肯定知道,js是可以传递函数的,而在 java中也有类似的特性,那就是匿名函数. 理解:行为参数化是一种方法, ...
- Spark学习笔记(二)—— Local模式
Spark 的运行模式有 Local(也称单节点模式),Standalone(集群模式),Spark on Yarn(运行在Yarn上),Mesos以及K8s等常用模式,本文介绍第一种模式. 1.Lo ...
- JavaSelenium 页面常用基本操作语法
元素定位 findElement() 方法返回一个元素, 如果没有找到,会抛出一个异常 NoElementFindException() fi ...