FastFieldSolvers Forum
FastFieldSolvers Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 FastFieldSolvers
 E.M. Workbench
 Python Import Error

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Antispam question: What do MOONwalk and MOONdance have in common?
Answer:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON

 
   

T O P I C    R E V I E W
lucasmr Posted - Mar 24 2022 : 19:20:09
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?


3   L A T E S T    R E P L I E S    (Newest First)
Enrico Posted - Mar 29 2022 : 18:20:35
You can contact me at

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

(remove the spaces and replace symbols accordingly)

Best Regards,
Enrico
lucasmr Posted - Mar 25 2022 : 21:36:21
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.
Enrico Posted - Mar 25 2022 : 16:40:50
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

FastFieldSolvers Forum © 2020 FastFieldSolvers S.R.L. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.06