Live data from Hacker News

JupyterLab 4.0

blog.jupyter.org

111–120 of 199 posts

Re: JupyterLab 4.0

#111
post #23
post #16

Earlier quoted context omitted.

> There aren't good boundaries between Jupyter's own Python environment, and that of your notebooks— if you have a dependency which conflicts with one of Jupyter's dependencies, then good luck. It's cumbersome, and I'm not totally sure it's the correct way, but I remember getting around this by creating a virtualenv for my projects and then using that virtualenv's python as Jupyter's "kernel".

This is the way. I use miniconda to create env for Jupyter and install only Jupyter and its dependency on that, then I just config it to point to all the other Python envs I use for my different projects. This is only one-time setup and it is absolutely worth it given how messy the ecosystem is.

> miniconda

Try micromamba, it will shave years off dependency resolution

Re: JupyterLab 4.0

#112
post #84

Earlier quoted context omitted.

Eh, print/log debugging works fine. Especially in an interactive environment: you've got direct access to the variables and objects, and can easily inspect them directly. At some point I felt like I was a bad dev for not using a debugger, but at this point I think I'm more versatile since I'm less dependent on finicky tooling to figure out what some code is doing... Every language has it's own debugger to learn, but…

Debugging nested dicts and high-dim arrays is a nightmare using print

Try `str`

Re: JupyterLab 4.0

#113

I keep experimenting with Jupyter in the context of telemetry/fault analysis and then hitting a wall with it where: - I get an analysis that I like, but there isn't a good way to share it with others, so I end up just taking screenshots. - There isn't a good way to take the same analysis and plug new data into it, other than to copy-paste the entire notebook. - The process to "promote" fragments of a notebook into be…

https://github.com/Anaconda-Platform/nb_conda_kernels

Re: JupyterLab 4.0

#114
post #104

Earlier quoted context omitted.

I just do a venv inside the venv so I can target several Python versions. I also use Jupiter for C#, Clojure, and Julia. I wish the Clojure integration was as good as the others I listed. I’m to the point now where if anything other than venv/pip is required I won’t use it. Unfortunately there are many things that insist on conda.

Conda is a fucking nightmare. Luckily you can usually just use pip to get the same packages.

[flagged]

Re: JupyterLab 4.0

#115

I keep experimenting with Jupyter in the context of telemetry/fault analysis and then hitting a wall with it where: - I get an analysis that I like, but there isn't a good way to share it with others, so I end up just taking screenshots. - There isn't a good way to take the same analysis and plug new data into it, other than to copy-paste the entire notebook. - The process to "promote" fragments of a notebook into be…

I've thought about this a lot in the context of our org. What you're describing is taking modeling -> production (minus the screen shot one).

Typically a data engineer will be the one who helps bridge that gap, but that has a problem of does data engineer's output == scientist output, which can be time consuming to handle.

To shrink the gap from dev->prod - we have 2 notebooks, one for model development and one model deployment in production. We use papermill[0] to execute directly notebooks in production.

Shared functions between the dev/prod that are built by the scientist are put into a separate notebook and then imported via `run`. If I'm honest, our scientist don't do this and simply copy/paste the functions if we don't yell at them to fix it.

This basically allows us to stay within the jupyter environment entirely so that dependancies are isolated.

So, it's far from perfect, but it's allowed us to shrink the dev->prod life cycle time. Love to hear what others have done towards the same end.

Re: JupyterLab 4.0

#116
post #16

I keep experimenting with Jupyter in the context of telemetry/fault analysis and then hitting a wall with it where: - I get an analysis that I like, but there isn't a good way to share it with others, so I end up just taking screenshots. - There isn't a good way to take the same analysis and plug new data into it, other than to copy-paste the entire notebook. - The process to "promote" fragments of a notebook into be…

> There aren't good boundaries between Jupyter's own Python environment, and that of your notebooks— if you have a dependency which conflicts with one of Jupyter's dependencies, then good luck. It's cumbersome, and I'm not totally sure it's the correct way, but I remember getting around this by creating a virtualenv for my projects and then using that virtualenv's python as Jupyter's "kernel".

I do this, but it isn't well supported. Most Jupyterlab extensions expect you to `pip install` and that will handle both the frontend and backend components. The docs make basically no mention of the frontend/backend split. I end up having to install a bunch of frontend stuff in my project envs just to make sure my notebooks work.

Re: JupyterLab 4.0

#117
post #76

Earlier quoted context omitted.

had a ton of trouble getting jupyterlab to target an arbitrary virtualenv

The trick is that you have to deactivate the virtual environment and then resource it after adding Jupyter to that virtual environment. Most shells cache executable paths, so the path for jupyter will be the global path, not the one for your virtual environment. This is unfortunately not at all obvious and leads to very hard to track down bugs that seem to disappear and reappear if you aren't familiar with the issue.…

I almost never rely on activating environments anymore. If it's in my project, I refer to it by its path relative to the project top level. If it's meant to be "global", I use Pipx, and if for some reason I can't, I use a script in ~/bin that uses the absolute path.

Re: JupyterLab 4.0

#118

Would this work as my main IDE?

I haven't upgraded to JupyterLab 4 because the plugins that I use to make jupyter lab IDE-like (jupyterlab-git, jupyterlab-vim, jupyterlab-lsp) need to all be stable on the new version first.

But, yeah, you can develop python software in Jupyterlab if that makes sense for you.

Re: JupyterLab 4.0

#119
post #11

Can somebody give me a quick rundown on the difference between JupyterLab and JupyterNotebook? Whose the target audience for each one?

Jupyter Notebook is a one-file-at-a-time interface.

Jupyter Lab lets you have multiple files/directories/terminal/csv files/json files/html pages/etc open at once in the same browser window.

Re: JupyterLab 4.0

#120

I keep experimenting with Jupyter in the context of telemetry/fault analysis and then hitting a wall with it where: - I get an analysis that I like, but there isn't a good way to share it with others, so I end up just taking screenshots. - There isn't a good way to take the same analysis and plug new data into it, other than to copy-paste the entire notebook. - The process to "promote" fragments of a notebook into be…

If you use conda there are extensions that can help with this by automatically registering any available conda environments that include ipykernel in your Jupyter Lab environment.

nb_conda_kernels is pretty reliable but not actively maintained. Gator from the mamba folks is new and still a bit rough around the edges but looks like it will be pretty slick eventually.

https://github.com/Anaconda-Platform/nb_conda_kernels

https://github.com/mamba-org/gator

Post reply on HN