Summary
There is a fundamental dependency incompatibility that makes tbselenium unusable with any version of Selenium:
tbselenium declares selenium >= 4 as a requirement (enforced by package managers like Poetry/pip)
- But the internal code still imports
FirefoxBinary from selenium.webdriver.firefox.firefox_binary, which was removed in Selenium 4
This creates an impossible situation:
| Scenario |
Result |
| Use Selenium 4.x (as required by tbselenium) |
ModuleNotFoundError: No module named 'selenium.webdriver.firefox.firefox_binary' at runtime |
| Downgrade to Selenium 3.141.0 |
Package manager rejects it — tbselenium declares selenium>=4 |
There is no valid pair of (selenium version, tbselenium version) that satisfies both the declared dependency constraint and works at runtime.
Reproduction
pip install tbselenium selenium
python -c "from tbselenium.tbdriver import TorBrowserDriver"
# ModuleNotFoundError: No module named 'selenium.webdriver.firefox.firefox_binary'
Or with Poetry:
[tool.poetry.dependencies]
selenium = "3.141.0" # Works at runtime but Poetry rejects: tbselenium requires >=4
tbselenium = "0.6.3"
[tool.poetry.dependencies]
selenium = "^4" # Accepted by Poetry, but crashes at runtime on import
tbselenium = "0.6.3"
Root Cause
FirefoxBinary was removed from Selenium in version 4.0. The tbselenium codebase has not been updated to remove this import or adapt to Selenium 4's API (which uses options.binary_location instead).
Expected Fix
- Remove the
FirefoxBinary import and replace usage with options.binary_location (Selenium 4 API)
- Update any other Selenium 3-only APIs used internally (e.g.,
executable_path in WebDriver constructors was also removed in Selenium 4.10+)
Environment
- Python 3.12
- selenium 4.x (latest)
- tbselenium 0.6.3 / 0.9.0 (both affected)
- Tested on macOS and Linux
Summary
There is a fundamental dependency incompatibility that makes
tbseleniumunusable with any version of Selenium:tbseleniumdeclaresselenium >= 4as a requirement (enforced by package managers like Poetry/pip)FirefoxBinaryfromselenium.webdriver.firefox.firefox_binary, which was removed in Selenium 4This creates an impossible situation:
ModuleNotFoundError: No module named 'selenium.webdriver.firefox.firefox_binary'at runtimeselenium>=4There is no valid pair of
(selenium version, tbselenium version)that satisfies both the declared dependency constraint and works at runtime.Reproduction
Or with Poetry:
Root Cause
FirefoxBinarywas removed from Selenium in version 4.0. Thetbseleniumcodebase has not been updated to remove this import or adapt to Selenium 4's API (which usesoptions.binary_locationinstead).Expected Fix
FirefoxBinaryimport and replace usage withoptions.binary_location(Selenium 4 API)executable_pathin WebDriver constructors was also removed in Selenium 4.10+)Environment