Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Next.js and React

ChromeDriverManager().install() crashes because no Chrome version was found

Your error

AttributeError: 'NoneType' object has no attribute 'split'1 more line it can show

Fix it fast

Most common cause, 1 of 3

webdriver-manager 4.0.1 has no guard for a missing version

Raise the pin in requirements.txt or pyproject.toml and reinstall.

Fix
pip install --upgrade "webdriver-manager>=4.1.2"
pip show webdriver-manager | grep ^Version
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

AttributeError: 'NoneType' object has no attribute 'split' from webdriver_manager/drivers/chrome.py means webdriver-manager 4.0.1 could not read an installed Chrome version and then split None. Usual reasons: only Chromium is installed, or no browser exists where the script runs. Set chrome_type=ChromeType.CHROMIUM, upgrade to webdriver-manager 4.1.2, or drop it for Selenium Manager.

  • Applies to webdriver-manager 4.0.1 (the crashing release) and 4.1.2, Selenium 4.53 for Python, Chrome 158 stable
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

In the same environment that runs the script (same user, same container), print the library versions and run the version commands webdriver-manager itself uses on Linux. Version 4.0.1 points to cause 1, a Chromium answer with no google-chrome answer to cause 2, and no answer at all to cause 3.

Run this first
pip show webdriver-manager selenium | grep -E "^(Name|Version)"
google-chrome --version; google-chrome-stable --version
chromium --version; chromium-browser --version
# macOS: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --version

Then find the line you see in this list and open its fix:

  1. 1webdriver-manager 4.0.1 has no guard for a missing versionpip show prints Version: 4.0.1 and the traceback ends at line 64 of drivers/chrome.py
  2. 2The machine has Chromium, not Google Chromechromium --version or chromium-browser --version prints a version, while every google-chrome command is not found
  3. 3No browser exists where the script actually runsEvery version command fails, typically in a slim Docker image, a CI job or a service account whose PATH differs from your shell

What does the error look like?

  • AttributeError: 'NoneType' object has no attribute 'split'
  • File ".../site-packages/webdriver_manager/drivers/chrome.py", line 64, in get_latest_release_version

Cause 1 of 3

webdriver-manager 4.0.1 has no guard for a missing version

You seepip show prints Version: 4.0.1 and the traceback ends at line 64 of drivers/chrome.py

Check

The 'NoneType' object has no attribute 'split' crash comes from a bug in webdriver-manager 4.0.1. When the browser lookup returns None, get_latest_release_version still runs determined_browser_version.split(".") on line 64. Release 4.0.2 and later check for None first and fall back to the latest release URL.

Check
pip show webdriver-manager | grep ^Version

Fix

Raise the pin in requirements.txt or pyproject.toml and reinstall. This removes the crash, but a driver can only match the browser when a browser is found, so read causes 2 and 3 as well.

Fix
pip install --upgrade "webdriver-manager>=4.1.2"
pip show webdriver-manager | grep ^Version

Verify

install() returns a file path instead of raising AttributeError.

Verify
python -c "from webdriver_manager.chrome import ChromeDriverManager; print(ChromeDriverManager().install())"

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 2 of 3

The machine has Chromium, not Google Chrome

You seechromium --version or chromium-browser --version prints a version, while every google-chrome command is not found

Check

ChromeDriverManager reads the Google Chrome version by default. On Linux it only tries google-chrome, google-chrome-stable, google-chrome-beta and google-chrome-dev, so a system that only has Chromium returns no version. The Chromium commands are only tried when chrome_type is set.

Check
which chromium chromium-browser google-chrome 2>/dev/null

Fix

Tell webdriver-manager to look for Chromium and point Selenium at the Chromium binary, as the project README shows.

Fix
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.os_manager import ChromeType

options = webdriver.ChromeOptions()
options.binary_location = "/usr/bin/chromium"
service = Service(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install())
driver = webdriver.Chrome(service=service, options=options)

Verify

Chromium opens and driver.capabilities shows its version.

Verify
python -c "from webdriver_manager.core.os_manager import OperationSystemManager, ChromeType; print(OperationSystemManager().get_browser_version_from_os(ChromeType.CHROMIUM))"

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 3 of 3

No browser exists where the script actually runs

You seeEvery version command fails, typically in a slim Docker image, a CI job or a service account whose PATH differs from your shell

Check

The library finds Chrome by running those commands by name (or a fixed /Applications path on macOS). In a container without a browser, or under a user whose PATH does not include it, nothing answers, the lookup comes back empty, and 4.0.1 crashes on it.

Check
command -v google-chrome chromium || echo "no browser on PATH for $(whoami)"

Fix

Remove webdriver-manager and let Selenium drive the setup. From Selenium 4.11, Selenium Manager downloads the stable Chrome for Testing build and a matching chromedriver into ~/.cache/selenium when Chrome is not installed.

Fix
pip uninstall -y webdriver-manager
pip install --upgrade selenium

# in code
from selenium import webdriver
driver = webdriver.Chrome()   # no Service(ChromeDriverManager().install())

Verify

The session starts, and ~/.cache/selenium now holds the browser and driver that Selenium Manager fetched.

Verify
ls ~/.cache/selenium

Confirmed by selenium.dev

Did this fix it?

How do I stop it coming back?

  • Pin webdriver-manager to 4.0.2 or later (or remove it) in every requirements file and lock file, not only on your laptop.
  • Run the first-step version commands as the CI or service user in a start-up check, so a browser missing from the image fails loudly before the tests.
  • Pass chrome_type explicitly whenever the target machine runs Chromium or Brave instead of Google Chrome.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine on the same stack: stegnor.com, Menulo, ShopGo.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.