python-indent icon indicating copy to clipboard operation
python-indent copied to clipboard

IndentationError: expected an indented block

Open pokervalkyrie opened this issue 4 years ago • 3 comments

Hi guys,

I am trying to run a basic script in atom (installed python-ide-terminal) with if , but get indentation error. i have also installed python indent. Going crazy trying to figure out where is the mistake. Please, help! :-/ Screenshot 2020-11-17 at 14 24 37

pokervalkyrie avatar Nov 17 '20 12:11 pokervalkyrie

I'm pretty sure that python-indent wouldn't cause this error.

I tried typing what you have here in my own file, and it worked fine. Have you tried running the file outside of Atom (e.g. in a terminal)? Could it be that you're using an older Python version and it doesn't like the Python 3 version of print("something") vs just print "something"?

DSpeckhals avatar Nov 17 '20 15:11 DSpeckhals

@DSpeckhals,

Thank you for the reply and the suggestion! It is exactly what I tried to do just before you wrote this - used Studio Visual Code- and it works perfectly! However, still doesn't solve the issue in Atom- everything seems up to date and using the latest Python version. Tried different print versions , same error.

pokervalkyrie avatar Nov 17 '20 16:11 pokervalkyrie

Maybe you wrote it before installing the package? It happened to me, I thought the package would resolve the indentation error of an existing code I wrote but apparantly it only helps when you write new code.. That's a feature I'd like the creator to add btw

OmerMaayan avatar Jan 03 '21 18:01 OmerMaayan