[Solved] IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
fiffo
Posts: 44
Joined: Wed Oct 18, 2017 8:57 am

[Solved] IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'

Post by fiffo »

Hi,
I try to import an IDF file (.emn file) but this error compare:

"Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\floriano\Desktop\freecad\FreeCAD_0.19.16944_x64_LP_12.1.2_PY3QT5-WinVS2015\FreeCAD_0.19.16944_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Idf\Idf.py", line 25, in <module>
import FreeCAD, Part, os, FreeCADGui, __builtin__
<class 'ModuleNotFoundError'>: No module named '__builtin__' "

The problem is because freecad moved to Python3:
How to solve the problem?
I thinks that need to change row 25 and 57 of idf.py

Thanks.

I used this version of Freecad = 0.19 ...
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16945 (Git)
Build type: Release
Branch: master
Hash: d818a9638424a934bd9da74d187a1af4cb773f05
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Last edited by Kunda1 on Tue Jun 18, 2019 2:05 pm, edited 1 time in total.
Reason: Added [Solved] to thread title
fiffo
Posts: 44
Joined: Wed Oct 18, 2017 8:57 am

Re: IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'

Post by fiffo »

Nothing to help me?
wmayer
Founder
Posts: 20326
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'

Post by wmayer »

Download the modified file of git commit aa76cb9b5 and replace that of your installation.
fiffo
Posts: 44
Joined: Wed Oct 18, 2017 8:57 am

Re: IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'

Post by fiffo »

Sorry but don't work.
I try to load isol.emn but this error appair:

Traceback (most recent call last):
File "<string>", line 1, in <module>
<class 'SyntaxError'>: invalid syntax (Idf.py, line 7)
wmayer
Founder
Posts: 20326
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'

Post by wmayer »

You must download it as raw file and not as HTML:
https://raw.githubusercontent.com/FreeC ... Idf/Idf.py
fiffo
Posts: 44
Joined: Wed Oct 18, 2017 8:57 am

Re: IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'

Post by fiffo »

Fantastic; now work.
Thanks a lot !!!
Post Reply