简体   繁体   中英

vs-code MS Python extension can't find autopep8 on Linux

Debian Stretch (9)

Extension: https://github.com/Microsoft/vscode-python

About VS Code:

Version: 1.32.3
Commit: a3db5be9b5c6ba46bb7555ec5d60178ecc2eaae4
Date: 2019-03-14T23:38:49.842Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Linux x64 4.9.0-8-amd64

hbarta@olive:~$ which autopep8
/usr/bin/autopep8
hbarta@olive:~$ 

The extension reports that it can't find autopep8 which I have installed via the Debian package manager. I can't figure out how to tell the extension where to find it.

Thanks!

To tell Code where autopep8 is, open the command palette(ctrl+alt+p), find "Preferences: Open Settings (JSON)" and add the following lines between the brackets ( {} )

    "python.formatting.provider": "autopep8",
    "python.formatting.autopep8Path": "/usr/bin/autopep8",

Then close and re-start Code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM