[0.17] Error: Initializing one or more of the Draft modules failed

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

[0.17] Error: Initializing one or more of the Draft modules failed

Post by NormandC »

Okay, weird stuff: all the Draft toolbars are gone in the latest Ubuntu daily build. :?
FC017_Draft_missing_toolbars_01.png
FC017_Draft_missing_toolbars_01.png (64.06 KiB) Viewed 3220 times
Report view reports errors:

Code: Select all

Error: Initializing one or more of the Draft modules failed, Draft will not work as expected.
Unknown command 'Draft_Line'
Unknown command 'Draft_Wire'
Unknown command 'Draft_Circle'
Unknown command 'Draft_Arc'
Unknown command 'Draft_Ellipse'
Unknown command 'Draft_Polygon'
Unknown command 'Draft_Rectangle'
Unknown command 'Draft_Text'
Unknown command 'Draft_Dimension'
Unknown command 'Draft_BSpline'
Unknown command 'Draft_Point'
Unknown command 'Draft_ShapeString'
Unknown command 'Draft_Facebinder'
Unknown command 'Draft_BezCurve'
Unknown command 'Draft_Label'
Unknown command 'Draft_Move'
Unknown command 'Draft_Rotate'
Unknown command 'Draft_Offset'
Unknown command 'Draft_Trimex'
Unknown command 'Draft_Upgrade'
Unknown command 'Draft_Downgrade'
Unknown command 'Draft_Scale'
Unknown command 'Draft_Edit'
Unknown command 'Draft_WireToBSpline'
Unknown command 'Draft_AddPoint'
Unknown command 'Draft_DelPoint'
Unknown command 'Draft_Shape2DView'
Unknown command 'Draft_Draft2Sketch'
Unknown command 'Draft_Array'
Unknown command 'Draft_PathArray'
Unknown command 'Draft_Clone'
Unknown command 'Draft_Drawing'
Unknown command 'Draft_Mirror'
Unknown command 'Draft_Stretch'
Unknown command 'Draft_Line'
Unknown command 'Draft_Wire'
Unknown command 'Draft_Circle'
Unknown command 'Draft_Arc'
Unknown command 'Draft_Ellipse'
Unknown command 'Draft_Polygon'
Unknown command 'Draft_Rectangle'
Unknown command 'Draft_Text'
Unknown command 'Draft_Dimension'
Unknown command 'Draft_BSpline'
Unknown command 'Draft_Point'
Unknown command 'Draft_ShapeString'
Unknown command 'Draft_Facebinder'
Unknown command 'Draft_BezCurve'
Unknown command 'Draft_Label'
Unknown command 'Draft_Move'
Unknown command 'Draft_Rotate'
Unknown command 'Draft_Offset'
Unknown command 'Draft_Trimex'
Unknown command 'Draft_Upgrade'
Unknown command 'Draft_Downgrade'
Unknown command 'Draft_Scale'
Unknown command 'Draft_Edit'
Unknown command 'Draft_WireToBSpline'
Unknown command 'Draft_AddPoint'
Unknown command 'Draft_DelPoint'
Unknown command 'Draft_Shape2DView'
Unknown command 'Draft_Draft2Sketch'
Unknown command 'Draft_Array'
Unknown command 'Draft_PathArray'
Unknown command 'Draft_Clone'
Unknown command 'Draft_Drawing'
Unknown command 'Draft_Mirror'
Unknown command 'Draft_Stretch'
Unknown command 'Draft_VisGroup'
Unknown command 'Draft_Heal'
Unknown command 'Draft_FlipDimension'
Unknown command 'Draft_ToggleConstructionMode'
Unknown command 'Draft_ToggleContinueMode'
Unknown command 'Draft_Edit'
Unknown command 'Draft_Slope'
Unknown command 'Draft_SetWorkingPlaneProxy'
Unknown command 'Draft_ApplyStyle'
Unknown command 'Draft_ToggleDisplayMode'
Unknown command 'Draft_AddToGroup'
Unknown command 'Draft_SelectGroup'
Unknown command 'Draft_SelectPlane'
Unknown command 'Draft_ShowSnapBar'
Unknown command 'Draft_ToggleGrid'
Unknown command 'Draft_AutoGroup'
Unknown command 'Draft_UndoLine'
Unknown command 'Draft_FinishLine'
Unknown command 'Draft_CloseLine'
Unknown command 'Draft_Snap_Lock'
Unknown command 'Draft_Snap_Midpoint'
Unknown command 'Draft_Snap_Perpendicular'
Unknown command 'Draft_Snap_Grid'
Unknown command 'Draft_Snap_Intersection'
Unknown command 'Draft_Snap_Parallel'
Unknown command 'Draft_Snap_Endpoint'
Unknown command 'Draft_Snap_Angle'
Unknown command 'Draft_Snap_Center'
Unknown command 'Draft_Snap_Extension'
Unknown command 'Draft_Snap_Near'
Unknown command 'Draft_Snap_Ortho'
Unknown command 'Draft_Snap_Special'
Unknown command 'Draft_Snap_Dimensions'
Unknown command 'Draft_Snap_WorkingPlane'
Draft workbench activated
I've been trying the following:
  • Rename ~/.FreeCAD folder to generate a fresh one
  • Delete ~/.config/FreeCAD/FreeCAD.conf
  • Restore original ~/.FreeCAD folder but delete user.cfg and system.cfg
I've been playing around these things because I want to salvage stuff I need in .FreeCAD (my own custom stylesheet, Mods).

At first one or more of the things I listed worked, but now I can't get it working again, even when deleting everything. :?

It started doing that with the daily build from 2 days ago, I just updated with the one from today, no success.

Any idea what's going on?!?

Thanks.


OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11424 (Git)
Build type: None
Branch: master
Hash: e7c7c07cdac6594c8519aca5775b21495ef8cdcb
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0

and

OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11432 (Git)
Build type: None
Branch: master
Hash: 0768ae99cfd6036601f66658f6e0f923de9af6f2
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [0.17] Error: Initializing one or more of the Draft modules failed

Post by NormandC »

I went back to this version from June 16th, which works:

OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11310 (Git)
Build type: None
Branch: master
Hash: d28bae3f52b3e7cf959e8b9f7bcff264f95db191
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0

I will test further and build from source.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [0.17] Error: Initializing one or more of the Draft modules failed

Post by NormandC »

Okay, I built from source, and Draft is still not initializing properly.

Could somebody else please confirm this?

Thanks!

Self-compiled:
OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11432 (Git)
Build type: Unknown
Branch: master
Hash: 0768ae99cfd6036601f66658f6e0f923de9af6f2
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
User avatar
yorik
Founder
Posts: 13597
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: [0.17] Error: Initializing one or more of the Draft modules failed

Post by yorik »

I don't see anything weird in Draft code... Could you try

Code: Select all

import Draft
import DraftTools
in the python console to see if any error message comes?
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [0.17] Error: Initializing one or more of the Draft modules failed

Post by NormandC »

Code: Select all

>>> import Draft
>>> import DraftTools
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/normand/compilation/FreeCAD/freecad-build/Mod/Draft/DraftTools.py", line 43, in <module>
    from DraftGui import todo, QtCore, QtGui, translate, utf8_decode
  File "/home/normand/compilation/FreeCAD/freecad-build/Mod/Draft/DraftGui.py", line 2141, in <module>
    FreeCADGui.draftToolBar = DraftToolBar()
  File "/home/normand/compilation/FreeCAD/freecad-build/Mod/Draft/DraftGui.py", line 304, in __init__
    self.setupTray()
  File "/home/normand/compilation/FreeCAD/freecad-build/Mod/Draft/DraftGui.py", line 650, in setupTray
    self.wplabel.setToolTip(translate("draft", "Current working plane:")+self.wplabel.text())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 22: ordinal not in range(128)
>>> 
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [0.17] Error: Initializing one or more of the Draft modules failed

Post by NormandC »

I just noticed your latest commit git commit 3ada141. Unfortunately it changes nothing.

OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11433 (Git)
Build type: Unknown
Branch: master
Hash: 3ada1416bad6518f3ee69bbcf7e11bbcbb2ff7ee
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0

Code: Select all

>>> import Draft
>>> import DraftTools
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/normand/compilation/FreeCAD/freecad-build/Mod/Draft/DraftTools.py", line 43, in <module>
    from DraftGui import todo, QtCore, QtGui, translate, utf8_decode
  File "/home/normand/compilation/FreeCAD/freecad-build/Mod/Draft/DraftGui.py", line 2141, in <module>
    FreeCADGui.draftToolBar = DraftToolBar()
  File "/home/normand/compilation/FreeCAD/freecad-build/Mod/Draft/DraftGui.py", line 304, in __init__
    self.setupTray()
  File "/home/normand/compilation/FreeCAD/freecad-build/Mod/Draft/DraftGui.py", line 650, in setupTray
    self.wplabel.setToolTip(translate("draft", "Current working plane:")+self.wplabel.text())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 22: ordinal not in range(128)
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [0.17] Error: Initializing one or more of the Draft modules failed

Post by NormandC »

Shot in the dark, I'm completely lost with this.

I found https://stackoverflow.com/questions/211 ... ecode-byte

Which made me try in FreeCAD's python console:

Code: Select all

>>> import sys
>>> sys.getdefaultencoding()
'ascii'
I'm guessing it should return utf8?

Checked with both 0.16.6710 and freecad-daily built from git commit d28bae3, both return ascii.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [0.17] Error: Initializing one or more of the Draft modules failed

Post by NormandC »

Could this be related? git commit fe66e96
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: [0.17] Error: Initializing one or more of the Draft modules failed

Post by sgrogan »

NormandC wrote: Sat Jun 24, 2017 7:21 pm Could somebody else please confirm this?
No problems here:
self-compiled
OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11433 (Git)
Build type: Unknown
Branch: master
Hash: 3ada1416bad6518f3ee69bbcf7e11bbcbb2ff7ee
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0

or freecad-daily
OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11432 (Git)
Build type: None
Branch: master
Hash: 0768ae99cfd6036601f66658f6e0f923de9af6f2
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0
"fight the good fight"
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: [0.17] Error: Initializing one or more of the Draft modules failed

Post by bejant »

NormandC wrote: Sat Jun 24, 2017 7:21 pm Could somebody else please confirm this?

Thanks!

It is fine for me as well using

OS: Ubuntu 16.04.2 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.17.11379 (Git)
Build type: None
Branch: master
Hash: 654276c49d1b66cf3c2a5ec538629c6d9f77c489
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0

and also after updating to the newest daily:

OS: Ubuntu 16.04.2 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.17.11432 (Git)
Build type: None
Branch: master
Hash: 0768ae99cfd6036601f66658f6e0f923de9af6f2
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Post Reply