PYTHON startupinfo) FileNotFoundError: [WinError 2] 系统找不到指定的文件。 错误解决方法

Traceback (most recent call last):
  File "D:/statashu/dustata1.py", line 4, in <module>
    subprocess.call(cmd)
  File "D:\Python37\lib\subprocess.py", line 339, in call
    with Popen(*popenargs, **kwargs) as p:
  File "D:\Python37\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "D:\Python37\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。


解决方法:根据提示找到lib中的subprocess.py文件,查找class Popen模块,再将这个模块中的__init__函数中的shell = False 改成shell = True。

 

posted @ 2023-04-22 09:32  myrj  阅读(956)  评论(0编辑  收藏  举报