Skip to content
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

Add nbextension/serverextension commands for uninstall/disable all #2149

Closed
ellisonbg opened this issue Feb 7, 2017 · 17 comments
Closed

Add nbextension/serverextension commands for uninstall/disable all #2149

ellisonbg opened this issue Feb 7, 2017 · 17 comments

Comments

@ellisonbg
Copy link
Contributor

It would be really helpful to have the following nbextension/server extension commands:

jupyter nbextension disable --all
jupyter nbextension uninstall --all
jupyter serveretension disable --all

that work with the different scope flags (--user, --sys-prefix, etc).

@takluyver
Copy link
Member

What's the use case? (Not trying to deny that there is one)

For testing with extensions disabled, we added an environment variable in jupyter_core, so you can run JUPYTER_NO_CONFIG=1 jupyter notebook

@ellisonbg
Copy link
Contributor Author

The usage case is refreshing installs of everything. I don't work in envs, so I often come back and sit down to re-install the entire extension stack based on latest versions (nbgrader, ipywidgets, lab extensions, etc.). What I find is that in previous installation rounds I sometimes installed into user without realizing it. If my new install goes into sys prefix I run into problems. I end up having to walk through the entire tree of config/data for user/sysprefix and system to find all previous installations/config and kill it all.

Some of this is that right now with JupyterLab we are seeing a huge amount of churn, so I have to do this often. But the same applies to nbextension/serverextensions (ipywidgets).

@ellisonbg
Copy link
Contributor Author

So for me it isn't a debug issue, more of an installation refresh question.

@ZelphirKaltstahl
Copy link

ZelphirKaltstahl commented Mar 20, 2017

I face similar problems as @ellisonbg .
I installed some self written extensions, but they installed somewhere on my system and I cannot find them. So now when I run my notebook, I cannot test my new versions, because it so happily loads the old versions from somewhere. In this specific case the old versions contained a wrong CSS file path and now the style sheet won't ever load, because it still uses that old code, where the path is wrong. It is so maddening. I used all of the following to no avail:

jupyter nbextension uninstall prototype-bla --sys-prefix
jupyter nbextension uninstall prototype-bla --sys-prefix
jupyter nbextension uninstall prototype-bla --system
jupyter nbextension uninstall prototype-bla --system
jupyter nbextension uninstall prototype-bla --user
jupyter nbextension uninstall prototype-bla --user
jupyter nbextension uninstall prototype-bla
jupyter nbextension uninstall prototype-bla

But the notebook still comes up with the extensions in the list of extensions in that tab, which lists them.

I also tried complete reinstall of my conda env. Nope. Still there. Please provide a universal uninstall way! Also extensions installed with --sys-prefix should always have higher priority than anything loaded from outside a conda env or virtualenv.

Edit:

I found the remaining installations. It seems there is also a jupyter installation in my base conda environment. In that my extensions were installed as well. The question then is, why would jupyter inside my actual conda env access extensions outside of the environment (in the conda base environment)? It should not do that.

@takluyver
Copy link
Member

I don't know why it would find them from your conda root env. You can see the directories it should be looking in with jupyter --paths, under data.

@ZelphirKaltstahl
Copy link

@takluyver Is there a way to restrict this? So that I could define "only look in your own env"?

@takluyver
Copy link
Member

You can effectively disable the user data directory by running the notebook server with APPDATA on Windows or XDG_DATA_HOME on Linux set to an empty directory. There's no equivalent of these on Mac.

We don't offer official ways to remove data directories, because data files by themselves aren't meant to have much effect, e.g. nbextensions are only loaded if they are enabled in config (which is in a different location).

The nbextensions you saw loaded from your conda root env represent either a bug or a misconfiguration (e.g. the notebook server was not running the way you thought it was running).

@ZelphirKaltstahl
Copy link

@takluyver Now that I found them and deleted them, it is not a problem anymore, but I think that exclusion of data directories would avoid future trouble, if I ever install an extension again without my shell script, which now always uses --sys-prefix and a threefold delete with --user, --sys-prefix and --system. So that could indeed be useful, thanks!

@gnestor
Copy link
Contributor

gnestor commented Jul 25, 2017

To clarify: we are proposing introducing an --all flag that would be the equivalent of using --user, --sys-prefix and --system?

@minrk
Copy link
Member

minrk commented Jul 31, 2017

@gnestor I think so. Though it should probably only modify levels where the config is explicitly present:

  1. check every level where the enable config is defined
  2. unset enabled there

@ellisonbg
Copy link
Contributor Author

ellisonbg commented Jul 31, 2017 via email

@takluyver
Copy link
Member

I believe this is now the last open issue for 5.1.

@minrk
Copy link
Member

minrk commented Aug 7, 2017

I think #2729 puts us in a good enough position on this for 5.1: uninstall no longer needs to be told where to uninstall from, so can be used to scrub out extensions.

@takluyver
Copy link
Member

I agree - I think there's more we can do based on this use case, but we have a concrete improvement, and it's not worth holding up 5.1 further to do more about this. So if @gnestor is OK with it, let's bump this to 5.2.

@minrk
Copy link
Member

minrk commented Aug 7, 2017

Agreed

@gnestor gnestor modified the milestones: 5.2, 5.1 Aug 7, 2017
@gnestor gnestor modified the milestones: 5.2, 5.3 Oct 9, 2017
@gnestor gnestor modified the milestones: 5.3, 5.4 Jan 5, 2018
@takluyver takluyver modified the milestones: 5.4, 5.5 Jan 27, 2018
@takluyver takluyver modified the milestones: 5.5, Backlog Mar 28, 2018
@michaelaye
Copy link

Looks like jupyter serverextension disable --all is still not possible despite #2715 being closed?

@jtpio
Copy link
Member

jtpio commented Jun 20, 2023

Closing as such feature is unlikely to be implemented in this repo.

An equivalent of jupyter nbextension disable --all could be supported in JupyterLab with jupyter labextension disable --all, and be available in Notebook 7.

For jupyter server extension disable --all this can be tracked on the Jupyter Server repo if the feature is still requested: https://github.com/jupyter-server/jupyter_server

Thanks all!

@jtpio jtpio closed this as completed Jun 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants