- Install
blackin your Python interpreter:pip install black - In VS Code, navigate: Preferences → Settings.
- Set: Format provider →
black. - Open
settings.jsonfrom the settings pane. - Add the following line:
"editor.formatOnSave": trueSet up VS Code to format with black on every save.
2020
black in your Python interpreter: pip install blackblack.settings.json from the settings pane."editor.formatOnSave": true