positron icon indicating copy to clipboard operation
positron copied to clipboard

bokeh plot library doesn't work on positron in windows

Open jonvanausdeln opened this issue 1 year ago • 0 comments

System details:

Positron and OS details:

Latest daily 2024.08.0-31 Windows 11

Interpreter details:

Python 3.12.2

Describe the issue:

bokeh library works in a python shell outside of Positron, but does not work inside positron using either a file or directly in the console. Looks to be missed in #4118

Steps to reproduce the issue:

Execute sample:

from bokeh.plotting import figure, show
p = figure(title="Simple line example", x_axis_label='x', y_axis_label='y')
p.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], legend_label="Temp.", line_width=2)
show(p)

Results in error output (this one is from a notebook)

{
	"name": "PermissionError",
	"message": "[Errno 13] Permission denied: 'c:\\\\Program Files\\\\Positron\\\\resources\\\\app\\\\extensions\\\\positron-python\\\\python_files\\\\positron\\\\positron_language_server.html'",
	"stack": "---------------------------------------------------------------------------
PermissionError                           Traceback (most recent call last)
Cell In[1], line 4
      2 p = figure(title=\"Simple line example\", x_axis_label='x', y_axis_label='y')
      3 p.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], legend_label=\"Temp.\", line_width=2)
----> 4 show(p)

File ~\\.pyenv\\pyenv-win\\versions\\3.12.2\\Lib\\site-packages\\bokeh\\io\\showing.py:147, in show(obj, browser, new, notebook_handle, notebook_url, **kwargs)
    144 state = curstate()
    146 if isinstance(obj, UIElement):
--> 147     return _show_with_state(obj, state, browser, new, notebook_handle=notebook_handle)
    149 def is_application(obj: Any) -> TypeGuard[Application]:
    150     return getattr(obj, '_is_a_bokeh_application_class', False)

File ~\\.pyenv\\pyenv-win\\versions\\3.12.2\\Lib\\site-packages\\bokeh\\io\\showing.py:198, in _show_with_state(obj, state, browser, new, notebook_handle)
    195     shown = True
    197 if state.file or not shown:
--> 198     _show_file_with_state(obj, state, new, controller)
    200 return comms_handle

File ~\\.pyenv\\pyenv-win\\versions\\3.12.2\\Lib\\site-packages\\bokeh\\io\\showing.py:179, in _show_file_with_state(obj, state, new, controller)
    175 def _show_file_with_state(obj: UIElement, state: State, new: BrowserTarget, controller: BrowserLike) -> None:
    176     '''
    177 
    178     '''
--> 179     filename = save(obj, state=state)
    180     controller.open(\"file://\" + filename, new=NEW_PARAM[new])

File ~\\.pyenv\\pyenv-win\\versions\\3.12.2\\Lib\\site-packages\\bokeh\\io\\saving.py:98, in save(obj, filename, resources, title, template, state)
     95 theme = state.document.theme
     97 filename, resources, title = _get_save_args(state, filename, resources, title)
---> 98 _save_helper(obj, filename, resources, title, template, theme)
     99 return abspath(expanduser(filename))

File ~\\.pyenv\\pyenv-win\\versions\\3.12.2\\Lib\\site-packages\\bokeh\\io\\saving.py:166, in _save_helper(obj, filename, resources, title, template, theme)
    163 from ..embed import file_html
    164 html = file_html(obj, resources=resources, title=title, template=template or FILE, theme=theme)
--> 166 with open(filename, mode=\"w\", encoding=\"utf-8\") as f:
    167     f.write(html)

PermissionError: [Errno 13] Permission denied: 'c:\\\\Program Files\\\\Positron\\\\resources\\\\app\\\\extensions\\\\positron-python\\\\python_files\\\\positron\\\\positron_language_server.html'"
}

Expected or desired behavior:

Plot to show

Were there any error messages in the UI, Output panel, or Developer Tools console?

jonvanausdeln avatar Aug 19 '24 16:08 jonvanausdeln