
I try to run bokeh server example (Bokeh server — Bokeh 3.8.2 Documentation)
under command mode, issue “bokeh serve --show myapp.py”, and get error as below:
ERROR: Error loading D:\project\BokehTest\myapp:
Invalid syntax in ‘main.py’ on line 1:
myapp.py
Traceback (most recent call last):
File “d:\project\bokehtest.venv\lib\site-packages\bokeh\application\handlers\code_runner.py”, line 106, in init
nodes = ast.parse(source, os.fspath(path))
File “C:\Users\Ixxxx\AppData\Local\Programs\Python\Python37\lib\ast.py”, line 35, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File “D:\project\BokehTest\myapp\main.py”, line 1
# myapp.py
^
SyntaxError: invalid character in identifier
Seems the python file cannot be compiled correctly.
“bokeh serve” and “python myapp.py” are all fine. Not sure if anything goes wrong.


