question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

autopep8 not formatting although it says it does

See original GitHub issue

What’s the output of :CocCommand pyright.version [coc.nvim] coc-pyright 1.1.127 with Pyright 1.1.127

I’m using the default configuration and somehow formatting with autopep8 does nothing. I’m wondering what the issue is.

Peek 2021-04-02 23-00

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ByteDrummercommented, Apr 3, 2021

Oh, I got it. I just ran sudo apt install python-is-python3 so that python points to python3 and it’s working now. Thank you!

0reactions
ByteDrummercommented, Apr 3, 2021

Not that exact command

$ cat temp.py 
from typing import List

# Reverse String
class Solution:
    def reverseString(self, s: List[str]) -> None:
        n = len(s)

        for i in range(n // 2):
            save = s[n - 1 - i]
            s[n - 1 - i] = s[i]
            s[i]            = save
$ python -m autopep8 temp.py 
Command 'python' not found, did you mean:
  command 'python3' from deb python3
  command 'python' from deb python-is-python3
$ python3 -m autopep8 temp.py 
from typing import List

# Reverse String


class Solution:
    def reverseString(self, s: List[str]) -> None:
        n = len(s)

        for i in range(n // 2):
            save = s[n - 1 - i]
            s[n - 1 - i] = s[i]
            s[i] = save

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio Code, autopep8 doesn't run - Stack Overflow
Go to File -> Preferences -> Keyboard Shortcuts, then search format . Set the shortcut as ctrl + shift + p which is...
Read more >
Format Document not working (autopep8, python, vscode)
When I run "Format Document", the file is not formatted. Steps to reproduce: Open a Workspace; Open up a Python File in the...
Read more >
Autopep8 not working in VSCode. Not sure what i've changed ...
Make sure VSCODE is using the same python interpreter that your command line is using. · Make sure you have installed AND UPDATED...
Read more >
Formatting | Python in Visual Studio Code
The default code format provider is autopep8. Auto Formatting. Formatting the source code as and when you save the contents of the file...
Read more >
Editing Python in Visual Studio Code
Troubleshooting formatting ; The formatter is not installed in the current environment. Open a command prompt, navigate to the location where your selected ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found