Python FileNotFoundError: [WinError 2] 系统找不到指定的文件。

============= RESTART: C:\Test_framework\src\test\test_baidu.py =============
Traceback (most recent call last):
  File "C:\Users\DLL\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 62, in start
    stdout=self.log_file, stderr=self.log_file)
  File "C:\Users\DLL\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 676, in __init__
    restore_signals, start_new_session)
  File "C:\Users\DLL\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 957, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

在lib文件夹中找到subprocess.py

1、搜索class Popen(object):

2、将__init__中的shell=False修改为shell=True

再运行问题解决。


猜你喜欢

转载自blog.csdn.net/u014094184/article/details/80085336