custom module can't be imported

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
student007
Posts: 6
Joined: Mon May 09, 2022 12:17 pm

custom module can't be imported

Post by student007 »

Hello!

I am currently writing a custom workbench. Therefor I created a new directory in the mod folder and put all the generated pyd and pdb files in it alongside the init.py and initGui.py
The module is displayed in freecad, but everytime I try to import the module with "import MODULE_NAME", the following error occurs:

13:16:26 DLL load failed while importing MODULE_NAME: Die angegebene Prozedur wurde nicht gefunden.
13:16:26 Traceback (most recent call last):
File "<string>", line 42, in Initialize
File "PATH_TO_FREECAD\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)

"FreeCAD.__modDirs__" tells me that the new subfolder in mod has been included.

Can anyone tell me what might have went wrong? I didn't really add any code of my own yet, simply copied the points workbench before running cmake and replaced all occurrences of the name by a new one (probably not the best practice but has worked for me before).
Since this project is for work I am sadly not able to provide any source code.

I created another workbench before which still works totally fine, so the problem must be somewhere in the source code of the new one (I think).

Any hint would be appreciated!
thanks

-----
OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 +99 (Git)
Build type: Release
Branch: Branch_0.19.3
Hash: 6530e364184ce05ccff39501e175cf2237e6ee4b
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: German/Germany (de_DE)
Post Reply