Setup Flake8 in VSCode
Quick setup & configuration guide
To use Flake8 in Visual Studio Code (VSCode), you can follow these steps:
Install Flake8:
Open the Command Palette with
Ctrl+Shift+P(orCmd+Shift+Pon macOS).Type “Select Linter” and press Enter.
Choose “Flake8” from the list.
Configure Flake8:
Go to the VSCode settings (
Ctrl+,orCmd+,on macOS).Search for “flake8” in the search bar.
Enable the option
Python > Linting: Flake8 Enabled.
Set the Flake8 Path (if necessary):
If Flake8 is not recognized automatically, you can set the path manually in the settings.
Find the setting
Python > Linting: Flake8 Pathand enter the path to your Flake8 executable.
Run Flake8:
Linting with Flake8 will run automatically when you open or save a Python file.
Errors and warnings will be highlighted in your code and displayed in the Problems panel (
Ctrl+Shift+MorCmd+Shift+Mon macOS).
NOTE
Remember, you need to have Flake8 installed in the Python environment that you’re using in VSCode.
If you have installed pylint before, you should disable it:
Command + Shift + P(orCtrl + Shift + Pon PC) in VSCode. This will open a command prompt at the top of the window. Then type the commandPython: Enable Linting, and selectoff.

