Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(jupyterlab): fix path to jupyter-lab if already installed #447

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

Merged
merged 2 commits into from
Apr 24, 2025

Conversation

cirego
Copy link
Contributor

@cirego cirego commented Apr 23, 2025

If the jupyter-lab binary already exists in $PATH, as found by command -v jupyter-lab, then we skip installing using pipx or uv.

By skipping the install path, we leave ${JUPYTERPATH} unset, which then leads to a broken module unless jupyter-lab just so happens to be installed at /jupyter-lab.

Fix this by calculating the full path to the binary, either from the install locations of pipx, uv or, in the case that it was preinstalled, from the preinstalled location.

I did not test this. I would have added a test but the current tests don't run because
they're too slow.

If the `jupyter-lab` binary already exists in $PATH, as found
by `command -v jupyter-lab`, then we skip installing using
`pipx` or `uv`.

By skipping the install path, we leave `${JUPYTERPATH}` unset, which then leads to a broken module unless `jupyter-lab` just so
happens to be installed at `/jupyter-lab`.

Fix this by calculating the full path to the binary, either from the
install locations of `pipx`, `uv` or, in the case that it was
preinstalled, from the preinstalled location.
@cdr-bot cdr-bot bot added the community Pull Requests and issues created by the community. label Apr 23, 2025
@cirego cirego changed the title Get full path to jupyter-lab if already installed bug: fix path to jupyter-lab if already installed Apr 23, 2025
@cirego cirego changed the title bug: fix path to jupyter-lab if already installed fix: fix path to jupyter-lab if already installed Apr 23, 2025
Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. Can you please bump the patch version in README.md examples?

It's a manual thing for now, we will soon automate it.

@matifali matifali changed the title fix: fix path to jupyter-lab if already installed fix(jupyterlab): fix path to jupyter-lab if already installed Apr 24, 2025
@matifali matifali merged commit cc567ed into coder:main Apr 24, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Pull Requests and issues created by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants