How to integrate pep8.py in Eclipse? How to integrate pep8.py in Eclipse? python python

How to integrate pep8.py in Eclipse?


As of PyDev 2.3.0, pep8 is integrated in PyDev by default, even shipping with a default version of it.

Open Window > Preferences

It must be enabled in PyDev > Editor > Code Analysis > pep8.py

Errors/Warnings should be shown as markers (as other things in the regular code analysis).

In the event a file is not analyzed, see https://stackoverflow.com/a/31001619/832230.


I don't know how to integrate it for whole project, but I have used it as an external tool to analyze an individual file.

Note that the pycodestyle package is the official replacement for and is the newer version of the pep8 package. To install it, run:

$ sudo pip install --upgrade pycodestyle

Next, in Eclipse:

  1. Select Run-External Tools-External Tools Configurations...
  2. Select Program root node.
  3. Press New launch configuration button.
  4. Enter Name for your launch configuration. I use pycodestyle.
  5. Fill following fields:

    Location -- ${system_path:pycodestyle}

    Working directory -- ${container_loc}

    Arguments -- "${resource_name}" (This uses the currently active file.)

Go to Common tab and confirm that the Allocate Console checkbox is checked.

A benefit of this approach is that you can use a very up-to-date version of the package, and are not limited to the old version included with PyDev. And if you are curious about setting up pylint in a similar manner, see this answer.


  1. Open your Eclipse
  2. Go to Help and select Install New Software
  3. Click the Add button and a "Add Repository" Dialog box will appear
  4. You can use any name you like for it. (I used PyDev)
  5. For the location, enter "http://pydev.org/updates"
  6. Click Ok.
  7. You are now in the process of installation. Just wait for it to finish.
  8. After the installation, close Eclipse and Open it again.
  9. Now that PyDev is installed in your Eclipse, go to Window->Preferences
  10. Choose PyDev->Editor->Code Analysis
  11. Go to pep8.py tab
  12. Choose the radio button for warning and click Ok.

That's it. Your Eclipse IDE is now integrated with PEP8.To run pep8.py automatically, right click on your project editor. Choose PyDev and click "code analysis". In your problems tab in your workspace, you will see warnings that points to the line that you have made a violation in the PEP8 (if you have violated).