Open SvenMeyer opened 4 years ago
The function "fix identation" does help here either.
I guess you mean here "does not help". But why not? What's the problem? Please be more specific.
On top of that when I actually give up and replace tabs with spaces, delete the tab, insert spaces, the "tool tips" pop up for no reason ... and if I press the wrong button, I also suddenly have some code in there which I did not want.
I don't understand very well what you mean here. Please create a simple video and post it here to clarify.
this error is so annoying, im not sure why it happens, everytime it happens i have to fix it by opening the code in sublime text-->view-->identation-->convert identation to tabs
this error is so annoying
But what is the error? Please post the error so we can understand how to fix it.
As I described in the initial post: "So I am copy-pasting a lot of code from external source, add something, ..." Likely there is some code with used tabs for indentation others spaces, so you end up with mixture of both and get said error message. In the meantime I discovered the option to display spaces and tabs, so in that case you could spot the problem, but still you would need to (manually?) change every ident.
@SvenMeyer, please upload a file with mixed tabs and spaces for which "Fix indentation" is not working, to see if we can reproduce the error in our side.
@ccordoba12 fyi it is hard to provide an example here. why? because by copying and pasting it here it can mix the hiden info that cause that error to happens
You can attach a file @isalirezag or provide us with an error traceback (or both :-) )
@isalirezag, you can upload a file directly here instead of pasting its contents.
@SvenMeyer, @isalirezag, we're still waiting for a file from you guys.
@ccordoba12 This should give you the error :)
Great, thanks!
@ccordoba12 This bug still exists in spyder 4.1.1 I'm using ubuntu 16.04 Python 3.6.6 64-bit | Qt 5.9.6 | PyQt5 5.9.2 | Linux 4.15.0-91-generic
just clear the indentation and then again give identation by tab. It works in my case in spyder4
@nishant2k how to clear the indentation? it does not work for me
Temporary solution is to change the indentation characters to 4 spaces in Tools>Preferences>Editor>Advanced settings.
same issue here: Ubuntu 18.04 Spyder 4.1.4 Python 3.8.3
Description
What steps will reproduce the problem?
I prefer Sypder over a larger IDE to have a lighter tool to try some code. So I am copy-pasting a lot of code from external source, add something, ... Too often I get the error message "TabError: inconsistent use of tabs and spaces in indentation", likely because some code uses spaces other tabs. Manual fixing this is quite cumbersome. The function "fix identation" does help here either.
On top of that when I actually give up and replace tabs with spaces, delete the tab, insert spaces, the "tool tips" pop up for no reason ... and if I press the wrong button, I also suddenly have some code in there which I did not want.
Makes this version of Spyder almost unusable ....
Versions
Dependencies