I'm having trouble installing spyder_autopep8
package/plugin to the newly released spyder 4 and getting it to work.
I've tried the these solutions: How to use autopep8 to format code in Spyder / Anaconda , Spyder plugins (spyder-autopep8)
but they seems to work only in spyder 3.3.X
.
There are some interesting new linting tools in spyder 4 but i couldn't find a tool that does what spyder_autopep8
do, i.e., formats the code as best it can to PEP8
.
This really helps the readability of my code. Maybe Spyder developers can shed light on this matter ?
Press Shift+F8 (default) to run autopep8 on the current file or go to Source > Run autopep8 code autoformatting. If some text is selected, autopep8 will run on this text only. Informations about the execution will be displayed in the statusbar.
To work with an existing environment in Spyder, you need to change Spyder's default Python interpreter. To do so, click the name of the current environment in the status bar, and then click Change default environment in Preferences. This will open the Preferences dialog in the Python interpreter section.
After activating your environment, to install Spyder and its other dependencies, run pip install spyder . You may need to install a Qt binding (PyQt5) separately with pip if running under Python 2. To launch Spyder after installing, ensure your environment is activated and run the spyder3 command.
(Spyder maintainer here) That plugin is not maintained anymore and it only works with Spyder 3.3.6.
That's because we added support to format code with Autopep8 and Black in Spyder 4.2.0, released in November 2020.
According to this issue on github https://github.com/spyder-ide/spyder-autopep8/issues/10 autopep8 is supported since spyder 4.2.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With