Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset iPython/Jupyter profile after upgrade to 'factory' defaults?

Returning to using iPython Notebooks after a year, [I installed my distro's version of Jupyter and now] Jupyter launches without menu bar. I'm guessing some of my old settings are carrying over. I'm guessing the fastest way to fix this is to .bak the old profile and create a new default.

First, initialized a Jupyter profile from instructions on how-to setup multiple Jupyter profiles:

$ jupyter notebook --generate-config

Then, [after further investigation] I created a new iPython profile,

$ ipython profile create foo

I followed found advise to renamed profile_foo to profile_default. Then,

Still not reset to 'factory'. What am I missing?

UPDATE: [edit] plus, I reordered what were my actual rebuilding profiles steps--in case there is some propagation of settings, where the order matters (haha. Maybe I'm recreating the incorrect order...?)

like image 863
xtian Avatar asked Aug 15 '16 01:08

xtian


Video Answer


2 Answers

You can use jupyter --paths to get a list of all the places Jupyter is storing dynamic data. That includes configuration + extensions + kernel information.

For me it looked like something like this:

$ jupyter --paths
config:
    /home/username/.jupyter
    /home/username/.pyenv/versions/miniconda3-4.3.30/etc/jupyter
    /usr/local/etc/jupyter
    /etc/jupyter
data:
    /home/username/Library/Jupyter
    /home/username/.pyenv/versions/miniconda3-4.3.30/share/jupyter
    /usr/local/share/jupyter
    /usr/share/jupyter
runtime:
    /home/username/Library/Jupyter/runtime

At your own risk: I just rm -r'ed every single directory listed by jupyter --paths, and that gave me a fresh "factory defaults" jupyter environment.

like image 198
Aaron V Avatar answered Oct 19 '22 11:10

Aaron V


Fixed!

I'm guessing there is a directed-ness to the Jupyter system (python, ipython, jupyter, a browser) where I have to reset parts in order.

I will take a guess and put these in a specific order. (Others can reorder if this turns out meaningful):

  1. Update python packages
  2. Created a new iPython profile: $ ipython profile create foo
  3. Rename profile_foo to profile_default
  4. Initialize a Jupyter profile: $ jupyter notebook --generate-config
  5. Clear the cache in your browser **:
    • Chrome (v52),
      • "Cookies and other site data"
      • "Cached images and files"
    • Firefox (v47),
      • "Offline web content and user data"
      • "Cached web content"

CAUTION: I'm assuming any existing iPython/Jupyter settings are not an issue, because the goal is to restore to factory, so to speak. And, I'm also assuming you're trying not to delete your saved passwords or bookmarks or history during a browser cache clearing step.

** I'm not clear which cache settings specifically include iPython/Jupyter data. These are only the settings I used and the problem was fixed.

like image 42
xtian Avatar answered Oct 19 '22 11:10

xtian