how to use autoPep8 extension with ipython notebook

8.7k views Asked by At

I'm new to python extensions and after installing autopep8 and ran:

jupyter nbextension enable jupyter-autopep8-master/jupyter-autopep8

It returned:

Enabling notebook extension jupyter-autopep8-master/jupyter-autopep8...
      - Validating: problems found:
        - require?  X jupyter-autopep8-master/jupyter-autopep8

But I don't see any new button on ipynb interface for automatically format code into pep8. How could I use the extension in ipynb? Thanks.

1

There are 1 answers

1
gogasca On

Verify that autopep8 is installed and also install the extension from repo:

pip install autopep8
jupyter nbextension install https://github.com/kenkoooo/jupyter-autopep8/archive/master.zip --user
jupyter nbextension enable jupyter-autopep8-master/jupyter-autopep8
jupyter nbextension list

Depending your Jupyter setup, you may want to restart your Jupyter service:

sudo service jupyter restart