Search code examples
pythonpython-2.7dockerpycharmpep8

PEP8 inspection in PyCharm not working with Docker remote python interpreter


I use local python interpreter, pep8 work well and I see all warnings in my files. Then I switch to remote python interpreter from Docker, all warnings disappeared.

Python on local and Docker: 2.7.12
Pycharm: PyCharm 2017.3.3 (Professional Edition) Build #PY-173.4301.16, built on January 11, 2018


Solution

  • As explained here, Pycharm needs a local interpreter in order to inspect the code. For me, the following worked:

    • Create a new (dummy) project
    • Configure a local Python interpreter for the dummy project
    • Close Pycharm
    • Open Pycharm and then open your original project that uses the remote interpreter
    • PEP8 inspection works! (granted that it is enabled in the settings)

    Basically my understanding is that it needs a local interpreter to be configured for some project but not necessarily for the specific project you want to run the inspection on.