I am getting below error, can you please enable chrome for me or advise other wise what could be the issue.
DEBUG:selenium.webdriver.remote.remote_connection:POST http://localhost:40337/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "chrome", "pageLoadStrategy": "normal", "goog:chromeOptions": {"extensions": [], "args": ["--headless", "--disable-gpu"]}}}}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): localhost:40337
DEBUG:urllib3.connectionpool:http://localhost:40337 "POST /session HTTP/1.1" 500 352
DEBUG:selenium.webdriver.remote.remote_connection:Remote response: status=500 | data={"value":{"error":"unknown error","message":"unknown error: Chrome failed to start: exited abnormally.\n (unknown error: DevToolsActivePort file doesn't exist)\n (The process started from chrome location /usr/bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)","stacktrace":"#0 0x564668767e89 \u003Cunknown>\n"}} | headers=HTTPHeaderDict({'Content-Length': '352', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request
---------------------------------------------------------------------------
WebDriverException Traceback (most recent call last)
Input In [32], in <cell line: 6>()
4 chrome_options.add_argument("--headless")
5 chrome_options.add_argument("--disable-gpu")
----> 6 browser = webdriver.Chrome(options=chrome_options)
8 try:
9 browser.get("https://www.google.com")
File /usr/local/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py:70, in WebDriver.__init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, service, keep_alive)
67 if not service:
68 service = Service(executable_path, port, service_args, service_log_path)
---> 70 super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
71 port, options,
72 service_args, desired_capabilities,
73 service_log_path, service, keep_alive)
File /usr/local/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py:92, in ChromiumDriver.__init__(self, browser_name, vendor_prefix, port, options, service_args, desired_capabilities, service_log_path, service, keep_alive)
89 self.service.start()
91 try:
---> 92 RemoteWebDriver.__init__(
93 self,
94 command_executor=ChromiumRemoteConnection(
95 remote_server_addr=self.service.service_url,
96 browser_name=browser_name, vendor_prefix=vendor_prefix,
97 keep_alive=keep_alive, ignore_proxy=_ignore_proxy),
98 options=options)
99 except Exception:
100 self.quit()
File /usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:275, in WebDriver.__init__(self, command_executor, desired_capabilities, browser_profile, proxy, keep_alive, file_detector, options)
273 self._authenticator_id = None
274 self.start_client()
--> 275 self.start_session(capabilities, browser_profile)
File /usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:365, in WebDriver.start_session(self, capabilities, browser_profile)
363 w3c_caps = _make_w3c_caps(capabilities)
364 parameters = {"capabilities": w3c_caps}
--> 365 response = self.execute(Command.NEW_SESSION, parameters)
366 if 'sessionId' not in response:
367 response = response['value']
File /usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:430, in WebDriver.execute(self, driver_command, params)
428 response = self.command_executor.execute(driver_command, params)
429 if response:
--> 430 self.error_handler.check_response(response)
431 response['value'] = self._unwrap_value(
432 response.get('value', None))
433 return response
File /usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py:247, in ErrorHandler.check_response(self, response)
245 alert_text = value['alert'].get('text')
246 raise exception_class(message, screen, stacktrace, alert_text) # type: ignore[call-arg] # mypy is not smart enough here
--> 247 raise exception_class(message, screen, stacktrace)
WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
#0 0x564668767e89 <unknown>