admin管理员组文章数量:1395014
I am hosting python script via:
bokeh serve example.py
and example.py loads local package 'local_module' located in the parent directory. When opening associated local host html (http://localhost:5006/example), the error pops up saying "ModuleNotFoundError: No module named 'local_module'".
If placing the 'example.py' file in the the parent directory (where the package 'local_module' is located) then "bokeh serve" runs successfully and package is located when launching the html.
Is there a way to configure Bokeh path variables that it would look into the local parent directory for the package (similarly like setting Python environment to look for local packages)?
Upon looking through possible Bokeh Settings (.html), it did not seem that any of the setting fields can be used to define the path that would be used to locate python packages.
I am using PyCharm project which automatically extends sys.path to include project scope (in the venv of the project), thus 'example.py' runs normally and locates the package.
I am running bokeh serve example.py
from the PyCharm terminal window that has project's venv loaded.
版权声明:本文标题:path - Python bokeh serve does not recognize local package located in the parent directory - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744108411a2591175.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论