FastFieldSolvers Forum
FastFieldSolvers Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
 All Forums
 FastFieldSolvers
 E.M. Workbench
 Python Import Error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

lucasmr

Brazil
2 Posts

Posted - Mar 24 2022 :  19:20:09  Show Profile  Reply with Quote
Hi!

When I open a previously saved project there is a python import error and FreeCad won't recognized all previously defined FHSegments.

There is a huge traceback; I will post only what seems the relevant part:

File "..\AppData\Roaming\FreeCAD\Mod\EM\EM_FHSegment.py", line 40, in <module>
from EM_Globals import makeSegShape
<class 'ImportError'>: cannot import name 'makeSegShape' from partially initialized module 'EM_Globals' (most likely due to a circular import) (..\AppData\Roaming\FreeCAD\Mod\EM\EM_Globals.py)

Does anyone have any idea how to fix that?


Enrico

542 Posts

Posted - Mar 25 2022 :  16:40:50  Show Profile  Reply with Quote
Any chance to share the offending file? In case you can send it to me at my email address you can find in the 'contacts' page.

Thank you
Enrico
Go to Top of Page

lucasmr

Brazil
2 Posts

Posted - Mar 25 2022 :  21:36:21  Show Profile  Reply with Quote
I am not able to send you an e-mail. There is this error

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'rs'

/forum/pop_mail.asp, line 228


I did read better the traceback and I noticed it was not that big. Actually, it was just repeating itself numerous times.
Here it is in its entirety.

==============================================================================================================
17:04:53 Traceback (most recent call last):

File "C:\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)

File "C:\Users\lucam\AppData\Roaming\FreeCAD\Mod\EM\EM_FHNode.py", line 38, in <module>
from EM_Globals import EMFHNODE_DEF_NODECOLOR

File "C:\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)

File "C:\Users\lucam\AppData\Roaming\FreeCAD\Mod\EM\EM_Globals.py", line 45, in <module>
import EM

File "C:\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)

File "C:\Users\lucam\AppData\Roaming\FreeCAD\Mod\EM\EM.py", line 58, in <module>
from EM_FHSegment import *

File "C:\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)

File "C:\Users\lucam\AppData\Roaming\FreeCAD\Mod\EM\EM_FHSegment.py", line 40, in <module>
from EM_Globals import makeSegShape

<class 'ImportError'>: cannot import name 'makeSegShape' from partially initialized module 'EM_Globals'
(most likely due to a circular import) (C:\Users\lucam\AppData\Roaming\FreeCAD\Mod\EM\EM_Globals.py)

==============================================================================================================

Nevertheless, after removing every "from EM_Globals import ..." from every file "EM_" listed at the traceback, the errors stopped.
Still, not it is ideal because now it is not able to export to an inp file.

==============================================================================================================
17:31:54 Running the Python command 'EM_FHInputFile' failed:
Traceback (most recent call last):
File "C:\Users\lucam\AppData\Roaming\FreeCAD\Mod\EM\EM_FHInputFile.py", line 187, in Activated
FreeCADGui.doCommand('obj=EM.createFHInputFile(App.ActiveDocument)')
File "<string>", line 1, in <module>
File "C:\Users\lucam\AppData\Roaming\FreeCAD\Mod\EM\EM_FHInputFile.py", line 150, in createFHInputFile
plane.Proxy.serialize(fid)
File "C:\Users\lucam\AppData\Roaming\FreeCAD\Mod\EM\EM_FHPlane.py", line 535, in serialize
node.Proxy.serialize(fid, EMFHNODE_DEF_NODENAMEEXT)

'NoneType' object has no attribute 'serialize'

==============================================================================================================

Removing the imports was a mistake, probably.
Go to Top of Page

Enrico

542 Posts

Posted - Mar 29 2022 :  18:20:35  Show Profile  Reply with Quote
You can contact me at

s u pp o rt <at> fastfieldsolvers <dot> com

(remove the spaces and replace symbols accordingly)

Best Regards,
Enrico
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
FastFieldSolvers Forum © 2020 FastFieldSolvers S.R.L. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.06