Error: Inconsistent use of tabs and spaces in indentation

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
ACSUS
Posts: 20
Joined: Fri Sep 25, 2020 9:09 pm

Error: Inconsistent use of tabs and spaces in indentation

Post by ACSUS »

I just downloaded the latest of 0.19. I am drawing a sheet metal by using Part Design WB first. Then, as soon as I switch to Sheet Metal WB, I get the error in the subject for (SheetMetalCmd.py, line 444). I think this is Python 3 issue, because I don't get any errors with V0.17.

Moreover, when I first start V0.19, I immediately get an error message:
During initialization the error "inconsistent use of tabs and spaces in indentation (<string>, line 71)" occurred in C:\Users\owner\AppData\Roaming\FreeCAD\Mod\exploded_animation\InitGui.py

Any comments?

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22846 (Git)
Build type: Release
Branch: master
Hash: 1f46b72491a0008384a6db4f2615a656249f6f08
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
Attachments
SheetMetalError1.png
SheetMetalError1.png (4.06 KiB) Viewed 1817 times
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Error: Inconsistent use of tabs and spaces in indentation

Post by heda »

A bit unfortunate that these things sneaks in. Py3 is pickier than py2 on allowing tabs as indent.

Good news is that it's an easy fix you can/should even do yourself when it's broken.
Just delete the tabs and replace it with spaces to get the right indention and problem gone.
And you have a perfect instruction of which lines it has to be done for.

And then hope that someone takes care of it based on a post like this so you don't have to do it for every update you make.

Happy "cadding".
chrisb
Veteran
Posts: 54303
Joined: Tue Mar 17, 2015 9:14 am

Re: Error: Inconsistent use of tabs and spaces in indentation

Post by chrisb »

Did you update SheetMetal to the latest version?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
ACSUS
Posts: 20
Joined: Fri Sep 25, 2020 9:09 pm

Re: Error: Inconsistent use of tabs and spaces in indentation

Post by ACSUS »

1- Updating the Sheet Metal WB solved the problem. However, as I mentioned initially, I did a fresh download & install of V0.19. Therefore, I assumed that all the files (WBs, macros, etc) were fresh, up to date. Now, I know they are not. So, it is a good practice to check updates of all the WBs and macros after the first install of a new version.

2- I edited the file and removed all the TABs in the .py file, only to get a new warning. Here are all the warning messages:
13:02:30 During initialization the error "unindent does not match any outer indentation level (<string>, line 71)" occurred in C:\Users\owner\AppData\Roaming\FreeCAD\Mod\exploded_animation\InitGui.py <------ No TABs at all in this line (71)!
13:02:30 Please look into the log file for further information <----- Cannot find such a file anywhere! Searched the whole drive!
13:02:39 Cannot find icon: :/icons/Sketcher_EditSketch.svg <------- Searched the internet, no such icons to download. It is not in the DIRs.
13:02:39 Cannot find icon: :/icons/Sketcher_LeaveSketch.svg <------- " " "

EDIT: Removed all the indentations from line 71 down. Finally the warning message is gone! Now, only those two yellow SVG warnings remaining to solve.

Thanks

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22846 (Git)
Build type: Release
Branch: master
Hash: 1f46b72491a0008384a6db4f2615a656249f6f08
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Error: Inconsistent use of tabs and spaces in indentation

Post by sgrogan »

ACSUS wrote: Wed Oct 28, 2020 8:19 pm EDIT: Removed all the indentations from line 71 down. Finally the warning message is gone! Now, only those two yellow SVG warnings remaining to solve.
Where do you get "exploded_animation" I don't see it in Addons-manager?
"fight the good fight"
chrisb
Veteran
Posts: 54303
Joined: Tue Mar 17, 2015 9:14 am

Re: Error: Inconsistent use of tabs and spaces in indentation

Post by chrisb »

The addons are third party software provided by eager community members. FreeCAD doesn't know about them until it is started and thus the update process doesn't handle them.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
ACSUS
Posts: 20
Joined: Fri Sep 25, 2020 9:09 pm

Re: Error: Inconsistent use of tabs and spaces in indentation

Post by ACSUS »

[/quote]
Where do you get "exploded_animation" I don't see it in Addons-manager?
[/quote]

In my PC, it is here:
C:\Users\owner\AppData\Roaming\FreeCAD\Mod\exploded_animation

But, I couldn't find the location of ":icons".
There are a bunch of "icons" DIRs in most of the Mod's sub-DIRs. I copied 2 "made-up" SVG files to all of the icons DIRs under Mod, but still get the warnings:
Cannot find icon: :/icons/Sketcher_EditSketch.svg
Cannot find icon: :/icons/Sketcher_LeaveSketch.svg
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Error: Inconsistent use of tabs and spaces in indentation

Post by sgrogan »

ACSUS wrote: Wed Oct 28, 2020 9:35 pm C:\Users\owner\AppData\Roaming\FreeCAD\Mod\exploded_animation
I see that. After some Duckcuck Go it looks like this is the precursor to " Exploded Assembly" https://github.com/JMG1/ExplodedAssembl ... b7952d15c6
I've installed this via Tools > Addon manager
and it installs and loads with no errors
"fight the good fight"
ACSUS
Posts: 20
Joined: Fri Sep 25, 2020 9:09 pm

Re: Error: Inconsistent use of tabs and spaces in indentation

Post by ACSUS »

I have no problem with Exploded_Animation anymore.
And, I already have the Exploded_Assembly. It came with the installation. However, I cannot update it. Well, when I do, the Start Screen complains as "already installed", meaning that I installed it over the original (now have 2 copies on top of each other)! I deleted the update, and everything went back to normal (with the original intact). I cannot remove the original either (to get a fresh update). It says "Unable to remove this addon".

So, the mystery goes on with those 2 icons..
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Error: Inconsistent use of tabs and spaces in indentation

Post by sgrogan »

ACSUS wrote: Wed Oct 28, 2020 10:18 pm So, the mystery goes on with those 2 icons..
They from an addon, which one?
C:\Users\owner\AppData\Roaming\FreeCAD\Mod\exploded_animation
I suggest you rename C:\Users\owner\AppData\Roaming\FreeCAD\Mod to C:\Users\owner\AppData\Roaming\FreeCAD\Mod-backup
And use Tools > Addon manager to re-install your needed addon wb's.

You may also need to rename C:\Users\owner\AppData\Roaming\FreeCAD\user.cfg and
C:\Users\owner\AppData\Roaming\FreeCAD\system.cfg
At next restart FreeCAD will create new ones. WARNING: prefs will be lost, so rename don't delete, so we can revert if necessary.
"fight the good fight"
Post Reply