5

I accidentally pressed some buttons on while I was working on Jupyterbook. Now, each cell shows a 'Run this cell (play button)' icon, which is visually distracting. I cannot find a toggle switch/command to turn it off.

Is there anyway I can turn it off?

SourabhJain
  • 55
  • 2
  • 6

2 Answers2

7

You most probably have upgraded the notebook package to the version 5.6.0 or higher.

pip show notebook

or

conda list notebook

will get you the exact version you have.

If the above is the case, unfortunately, your options are limited and are as follows.

  • Downgrade

    pip install notebook==5.5.0
    

    or

    conda install notebook==5.5.0
    
  • Customize local CSS

    Add the following code (сheck out this thread for more flexible and sophisticated solutions) to your custom.css file.

    .code_cell .run_this_cell {
        display: none;
    }
    

    If you're using Conda on Linux you can find the file at (depending on the version of Python you're on)

    ~/anaconda3/lib/python3.7/site-packages/notebook/static/custom/custom.css
    

    For Conda on Windows try

    C:\Users\UserName\Anaconda3\Lib\site-packages\notebook\static\custom\custom.css
    

    Check answers to this question for more details on where the file could be found.

    Alternatively, you can create a new file my-custom.css, put it anywhere you want and then reference it from every notebook individually by using IPython's HTML cell magic

    %%html
    <link rel="stylesheet" href="somewhere-on-your-machine/my-custom.css" />
    

    or explicitly, without needing to create any files

    %%html
    <style>
    .code_cell .run_this_cell {
        display: none;
    }
    </style>
    
ayorgo
  • 2,803
  • 2
  • 25
  • 35
1

A simpler way of solving this is to select the cells, change them to markdown and then change back to code.

hsxavier
  • 89
  • 3
  • Thank you! I was baffled I had to downgrade, change style and so on to revert a typo in my keyboard shortcut. Best solution IMO – NorTicUs Sep 30 '21 at 09:31