Skip to content
Advertisement

How to stop autopep8 not installed messages in Code

I’m a new Python programmer using the Mac version of VS Code 1.45.1 to create a Django project. I have the Python and Django extensions installed. Every time I save a Django file, Code pops up this window:

Formatter autopep8 is not installed.  Install?
Source: Python (Extension)  [Yes] [Use black] [Use yapf]

I keep clicking the “Yes” button to install the autopep8 extension but this message keeps popping up nevertheless. Is there some trick to configuring VS Code so that this extension will be installed permanently and I stop getting this error?

Advertisement

Answer

You will receive this prompt if

  1. You have "formatOnSave" turned on as a setting
  2. You selected autopep8 as your formatter
  3. The Python extension can’t find autopep8

So the options are:

  1. Turn off formatting on save
  2. Make sure you successfully installed autopep8 into your environment or you specified the path to autopep8 in your settings

My guess is there’s an installation failure because you are using a globally installed interpreter and you’re not allowed to install where pip wants to put autopep8.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement