-
-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render with Panel button breaks with Jupyterlab root_dir #3170
Comments
Thanks @govinda18! Would absolutely love to see a PR with your suggested changes. |
govinda18
added a commit
to govinda18/panel
that referenced
this issue
Feb 3, 2022
Jupyter sends path relative to the root_dir which can be different from the cwd. This commit fixes the lab extension for panel preview to account for root_dir. Reference: holoviz#3170
Done. |
philippjfr
pushed a commit
that referenced
this issue
Feb 3, 2022
Jupyter sends path relative to the root_dir which can be different from the cwd. This commit fixes the lab extension for panel preview to account for root_dir. Reference: #3170
philippjfr
pushed a commit
that referenced
this issue
Mar 26, 2022
Jupyter sends path relative to the root_dir which can be different from the cwd. This commit fixes the lab extension for panel preview to account for root_dir. Reference: #3170
philippjfr
added a commit
that referenced
this issue
Mar 27, 2022
* Fix jinja2 imports (#3258) * fix: wrong offset when memoryview format is non-byte (#3206) the offset should be in bytes, not elements. See also bokeh/ipywidgets_bokeh#46 (comment) * Support jupyter server root_dir with lab extension (#3172) Jupyter sends path relative to the root_dir which can be different from the cwd. This commit fixes the lab extension for panel preview to account for root_dir. Reference: #3170 * DOC: add note on enabling panel widget on Jupyter Lab (#3029) * Remove redundant and confusing JupyterLab install instructions (#3037) * Remove reference to Python 2 and link to Travis * Remove redondant install instructions to work with Jupyter * Update CHANGELOG * Add setuptools to build requirements * use https instead of the git:// protocol in GHA (#3092) * Try to switch to setuptools (#3138) * Try to switch to setuptools * Continue on error * CI: fix Macos tests workflow (#3160) * attempt to fix CI on macos * forgot bokeh channel * remove strict setting * reset strict and add pyctdev channel * remove continue_on_error and test py310 * clean up test workflow * add comment about PYCTDEV_SELF_CHANNEL * remove py310 * Revert change to build backend * Update setuptools pin * Pin setuptools * Further pin updates * Pin setuptools (#3265) * Fix image_url test * Pin pyvista * Bump panel.js version * Fix GH workflows * Bump panel.js version Co-authored-by: Maarten Breddels <maartenbreddels@gmail.com> Co-authored-by: Govinda Totla <govinda.totla.cse16@itbhu.ac.in> Co-authored-by: Ray Bell <rayjohnbell0@gmail.com> Co-authored-by: Maxime Liquet <35924738+maximlt@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ALL software version info
Jupyterlab 3.2.8
Panel master
Description of expected behavior and the observed behavior
Hi team, jupyterlab allows you to set a custom root_dir and preferred_dir config for your server app. You can set it using the following:
Then in your
~/.jupyter
folder you should findjupyter_notebook_config.py
and there we can set a configuration like:Now when you launch jupyter, the jupyter extensions get file path relative to the
root_dir
. So suppose you launch your lab from/home/gt
and root dir is set to/
and we try to render a panel preview for a file located at/home/gt/notebook.ipynb
, this will break as the path passed to the PanelHandler.get is actuallyhome/gt/notebook.ipynb
but the bokeh utility here tries to get abspath which is relative to cwd (which is /home/gt) and it turns out to be/home/gt/home/gt/notebook.ipynb
.Here, what the PanelHandler should be doing is setting the path to bokeh as
root_dir + path
. A good example is the FileContentsManager of jupyter extension. As you can see here, for all the utility it evaluates the path relative to the root dir.Complete, minimal, self-contained example code that reproduces the issue
This simple code throws 500 Internal server errors if the following configuration is done -
and the lab is launched from a directory other than the root_dir. What the above config does is it allows you to access files outside your cwd as well from the lab.
Stack traceback and/or browser JavaScript console output
Proposed Fix
A simple fix here would be similar to what FileContentManager does:
Similarly, this should be done for PanelWSHandler as well. I was able to make it work with the above change. If this looks fine, I would be happy to raise a PR too. Please let me know if you feel there is a better way to achieve the same.
The text was updated successfully, but these errors were encountered: