5

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 ?

Ziskin_Ziv
  • 116
  • 4

2 Answers2

3

(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.

Carlos Cordoba
  • 33,273
  • 10
  • 95
  • 124
  • 2
    Thank you very much for your work on Spyder, It is a very useful and effective tool in my scientific work. – Ziskin_Ziv Jan 27 '20 at 06:47
  • @CarlosCordoba thanks for all the work with Spyder, version 4 is great. Any progress with the autopep8 stuff? – mathisfun Feb 27 '20 at 15:16
  • @mathisfun, thanks for your kind words! There's no progress yet, but I hope to have it ready by the end of March. – Carlos Cordoba Feb 27 '20 at 17:10
  • 1
    Can vouch that it works great in Spyder 4.2. `preferences→completion and linting→code style and formatting→ code formatting →autoformat files on save` – eric Oct 28 '21 at 02:43
2

According to this issue on github https://github.com/spyder-ide/spyder-autopep8/issues/10 autopep8 is supported since spyder 4.2.0

onno
  • 969
  • 5
  • 9