☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Select a folder with bokeh

Community Supportbokeh
Bryan
Bryan

No it’s not possible with Bokeh, and I am not sure it is even possible in principle, since browsers will not return local filesystem path information due to security concerns (which is why, for example, the FileInput can only return the file name and nothing more about the full path)

⌁   Link to post
kaprisonne
kaprisonne

I have stumbled over a similar problem, I really wanted to have the FULL filepath, which is impossible just like @Bryan said.

However, if you are using the bokeh server AND the server is running on your local machine you could use a Desktop-based file selector, instead, that supports selecting a folder.
E.g., clicking a button makes the bokeh-server open a tkinter directoryselect-window and you can then use the path of the selected directory in whatever way.

I used something like this:

Tkinter askdirectory
from tkinter import Tk
from tkinter.filedialog import askdirectory

from bokeh.io import curdoc
from bokeh.layouts import column
from bokeh.models import Button, PreText

selected_path_tf = PreText()

def select_file():
    root = Tk()
    root.attributes('-topmost', True)
    root.withdraw()
    dirname = askdirectory()  # blocking
    if dirname:
        selected_path_tf.text = dirname

dir_input_btn = Button(label="Select Directory")
dir_input_btn.on_click(lambda x: select_file())


curdoc().add_root(column(dir_input_btn, selected_path_tf))

Alternatively you can collect all directories of your current file system and use a modified Table to display them for the user to choose one. That’s how most people do it (google drive for example).

⌁   Link to post

End of archived discussion · Replies are disabled