I'm developing a python application which uses Bokeh and PubSub and other python modules. I'm almost done with it and it's running fine. But when I tried to make an executable out of it by using PyInstaller, I ran into a lot of problems. I solved the Jinja2 TemplateNotFound and the unregistered loader type issue by using @dzman's post from this thread. I solved the PubSub import problem by using @Stefano's post from this thread. Now the problem is, when I am trying to run the .exe file it throws error as shown below
Traceback (most recent call last):
File "module1.py", line 191, in <lambda>
File "module1.py", line 274, in getQueryItems
File "module1.py", line 353, in queryTheDatabaseToGetResult
File "module1.py", line 399, in createDataframeFromTheResult
File "module2.py", line 17, in __init__
File "module2.py", line 75, in plotFunction
File "site-packages\bokeh\models\callbacks.py", line 68, in
from_coffeescript
File "site-packages\bokeh\util\compiler.py", line 190, in nodejs_compile
File "site-packages\bokeh\util\compiler.py", line 169, in _run_nodejs
File "site-packages\bokeh\util\compiler.py", line 164, in _run
RuntimeError: module.js:538
throw err;
^
Error: Cannot find module 'C:\Users\user_name\Desktop\PYTHON~1\dist\PATHWA~1\bokeh\server\static\js\compiler.js'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
In the code the error occurs right at the very last line of the following code snippet,
checkbox.callback = CustomJS.from_coffeescript(args = dict(plot = fig, checkbox = checkbox), code="""
rends = plot.select("hideable");
rends[i].visible = i in checkbox.active for i in [0...rends.length];
""") #This is line 68 as shown in the error message
So, it's the CustomJS where the code is failing. I could not find a single post that describes how to use PyInstaller with Custom JS in Bokeh. But I really need to do this as I have to distribute the executable. Any help is highly appreciated and thanks in advance !!
I'm using Pyinstaller 3.3.1, Python 2.7 and Bokeh 0.12.11