Remove play button display at every cell line of Jupyter notebook

为君一笑 提交于 2019-12-13 17:47:30

问题


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?


回答1:


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>
    


来源:https://stackoverflow.com/questions/54607200/remove-play-button-display-at-every-cell-line-of-jupyter-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!