ModuleNotFoundError on my first macro :(

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
viktak
Posts: 24
Joined: Tue Oct 19, 2021 2:36 pm
Contact:

ModuleNotFoundError on my first macro :(

Post by viktak »

Dear all,

I am a newcomer to FreeCAD and have been enjoying it so far. Today, I created my first macro, but it doesn't seem to work at all.
I simplified it to less than the minimum, but even that fails.

Here is the macro:

Code: Select all

import FreeCAD
import gui_shapestrings
Here is the error message:

Code: Select all

17:37:01  Traceback (most recent call last):
  File "C:/Users/Viktor/AppData/Roaming/FreeCAD/Macro/CreateLetter.FCMacro", line 5, in <module>
    import gui_shapestrings
  File "C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
<class 'ModuleNotFoundError'>: No module named 'gui_shapestrings'
I'm not a Python guru, but I guess I need some path or extra libraries installed. I think this is a very basic issue - for someone more intimate with FreeCAD.

Could someone please put me in the right direction?

I am using a standard installation of the latest version of FreeCAD on Windows 10.

Thank you in advance!
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: ModuleNotFoundError on my first macro :(

Post by wmayer »

Hi,

try this

Code: Select all

import FreeCAD
from draftguitools import gui_shapestrings
viktak
Posts: 24
Joined: Tue Oct 19, 2021 2:36 pm
Contact:

Re: ModuleNotFoundError on my first macro :(

Post by viktak »

Yepp, this helped. Thank you.

However, I am still getting other error messages, now on the actual macro actions that were recorded by FreeCAD itself. I'll try to figure this out myself, though. If I can't figure it out, I'll be back! :)

Thank you for the help!
Post Reply