First of all, I’ve searched and feel like this has been partially answered elsewhere, but I’m just trying to get a firm, final answer-- I apologize if this duplicates anything.
We’ve got three Bokeh apps, each of which is a fairly heavy dashboard for three different software products. The directory structure looks like this:
parent_project_dir
support_files
support_functions_i_want_to_use.py
dashboard_1_app
main.py
(etc)
dashboard_2_app
main.py
(etc)
dashboard_3_app
main.py
(etc)
So far I have not managed to have a dashboard able to import the support functions. (These functions were written before these apps were apps, when they were just static scripts, and we’ve since converted them to have more dynamic interactivity.) I can replicate the functions within a support file under each dashboard_n_app directory, but that seems unwieldy, especially when all three need the same thing-- copying and pasting (and triplicating maintenance effort in the future) just seems wrong.
Is it correct that this is not possible? Are there options?
There's not really going to be any good way to do this if you run "bokeh serve" as a separate process. Think about if you had just run "python main.py" for instance. You would not be able to import random files higher up in the filesystem in that case either. Some ideas:
* explicitly munging sys.path to include the location of this module you need
* embedding the Bokeh server as library in a python script that you start that has visibility into this entire package/directory structure, see examples/howto/server_embed
* put this module in a package that is actually installed in your site-packages
First of all, I've searched and feel like this has been partially answered elsewhere, but I'm just trying to get a firm, final answer-- I apologize if this duplicates anything.
We've got three Bokeh apps, each of which is a fairly heavy dashboard for three different software products. The directory structure looks like this:
So far I have not managed to have a dashboard able to import the support functions. (These functions were written before these apps were apps, when they were just static scripts, and we've since converted them to have more dynamic interactivity.) I can replicate the functions within a support file under each dashboard_n_app directory, but that seems unwieldy, especially when all three need the same thing-- copying and pasting (and triplicating maintenance effort in the future) just seems wrong.
Is it correct that this is not possible? Are there options?