Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] cannot import name 'WebDriver' from 'bokeh.io.webdriver' in bokeh 3.3.3 #13653

Closed
bjfar opened this issue Jan 22, 2024 · 1 comment
Closed

Comments

@bjfar
Copy link

bjfar commented Jan 22, 2024

Software versions

Python version : 3.10.13 | packaged by conda-forge | (main, Dec 23 2023, 15:36:39) [GCC 12.3.0]
IPython version : (not installed)
Tornado version : 6.3.3
Bokeh version : 3.3.3
BokehJS static path : /home/benf/micromamba/envs/bokeh_test/lib/python3.10/site-packages/bokeh/server/static
node.js version : (not installed)
npm version : (not installed)
jupyter_bokeh version : (not installed)
Operating system : Linux-5.15.0-91-generic-x86_64-with-glibc2.31

Browser name and version

No response

Jupyter notebook / Jupyter Lab version

No response

Expected behavior

>>> import bokeh
>>> bokeh.__version__
'3.3.2'
>>> import bokeh.io.webdriver as wd
>>> wd.WebDriver
<class 'selenium.webdriver.remote.webdriver.WebDriver'>

Observed behavior

>>> import bokeh
>>> bokeh.__version__
'3.3.3'
>>> import bokeh.io.webdriver as wd
>>> wd.WebDriver
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'bokeh.io.webdriver' has no attribute 'WebDriver'

I cannot find anything in the changelog for 3.3.2 to 3.3.3 that indicates a deprecation related to this. Maybe I missed it though?

Example code

>>> import bokeh.io.webdriver as wd
>>> wd.WebDriver


### Stack traceback or browser console output

_No response_

### Screenshots

_No response_
@bjfar bjfar added the TRIAGE label Jan 22, 2024
@bryevdv
Copy link
Member

bryevdv commented Jan 22, 2024

@bjfar WebDriver is a Selenium API and was only coincidentally "available" as a transitive import. It was only imported at the top level for type checking purposes, and that import caused substantial increase in import times, so it was moved behind a type check guard, where it should have been to begin with:

if TYPE_CHECKING:
    from selenium.webdriver.remote.webdriver import WebDriver

In any case, it was never intended to be "Bokeh API", since it is actually a part of Selenium. If you actually need it directly, you should import it from Selenium yourself, or otherwise use actual Bokeh APIs to generate a webdriver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants