json.decoder.JSONDecodeError in ChromeDriverManager().install()

Viewed 20

Up until last night, when the last install was attempted, the code worked fine and I made no changes. Then, I get this Traceback from the terminal when I run my program again:

<snip>
cd_service_obj = Service(ChromeDriverManager().install())
  File "C:\...\my_venv\lib\site-packages\webdriver_manager\chrome.py", line 39, in install  
    driver_path = self._get_driver_path(self.driver)
  File "C:\...\my_venv\lib\site-packages\webdriver_manager\core\manager.py", line 26, in _get_driver_path
    binary_path = self.driver_cache.find_driver(driver)
  File "C:\...\my_venv\lib\site-packages\webdriver_manager\core\driver_cache.py", line 101, 
in find_driver
    metadata = self.get_metadata()
  File "C:\...\my_venv\lib\site-packages\webdriver_manager\core\driver_cache.py", line 135, 
in get_metadata
    return json.load(outfile)
  File "C:\Users\myself\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Users\myself\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\myself\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\myself\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I rebuilt the entire virtual environment and still got this error. What's causing it, and how can I fix it?

1 Answers

Until a better answer comes along, I just didn't include the service parameter in the Chrome() object and commented out the line of code that created the Service() object, and that "fixed" it.

Related