Ciao a tutti,
provo ad importare un file IDF (.emn file) ma mi compare questo errore... come se mancasse il modulo "builtin" ...
qualcuno mi può aiutare?
"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__' "
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)
[Solved] IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'
Forum rules
regole del forum e le informazioni utili
Importante: PRIMA di chiedere aiuto leggete qui!
regole del forum e le informazioni utili
Importante: PRIMA di chiedere aiuto leggete qui!
[Solved] IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'
Last edited by Kunda1 on Tue Jun 18, 2019 2:06 pm, edited 1 time in total.
Reason: Added [Solved] to this thread
Reason: Added [Solved] to this thread
-
- Veteran
- Posts: 2611
- Joined: Tue Feb 21, 2012 8:07 pm
- Location: Torino - Italy
Re: IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'
Ciao.
Il problema è dovuto al passaggio a Python3:
Renamed module __builtin__ to builtins (removing the underscores, adding an ‘s’). The __builtins__ variable found in most global namespaces is unchanged. To modify a builtin, you should use builtins, not __builtins__!
Puoi vedere altro in https://docs.python.org/3.0/whatsnew/3.0.html
Correggendo le righe 25 e 57 di C:\Program Files\FreeCAD 0.18\Mod\Idf\Idf.py, o dove-si-trova il tuo Mod\Idf, dovrebbe funzionare.
Il problema è dovuto al passaggio a Python3:
Renamed module __builtin__ to builtins (removing the underscores, adding an ‘s’). The __builtins__ variable found in most global namespaces is unchanged. To modify a builtin, you should use builtins, not __builtins__!
Puoi vedere altro in https://docs.python.org/3.0/whatsnew/3.0.html
Correggendo le righe 25 e 57 di C:\Program Files\FreeCAD 0.18\Mod\Idf\Idf.py, o dove-si-trova il tuo Mod\Idf, dovrebbe funzionare.
Re: IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'
Grazie mille per la risposta...
sai per caso come le devo modificare?
sai per caso come le devo modificare?
-
- Veteran
- Posts: 2611
- Joined: Tue Feb 21, 2012 8:07 pm
- Location: Torino - Italy
Re: IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'
riga 25 di Idf.py
e poi riga 57
provato, funziona in
OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
Code: Select all
import FreeCAD, Part, os, FreeCADGui, builtins
Code: Select all
pythonopen = builtins.open # to distinguish python built-in open function from the one declared here
OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
Re: IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'
it could be a Pull Request then
Re: IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'
Grazie mille Renato.
Avevo postato lo stesso quesito anche nel forum in inglese dove anche là mi avevano risposto.
Avevo postato lo stesso quesito anche nel forum in inglese dove anche là mi avevano risposto.
-
- Veteran
- Posts: 2611
- Joined: Tue Feb 21, 2012 8:07 pm
- Location: Torino - Italy
Re: [Solved] IDF import: error import "<class 'ModuleNotFoundError'>: No module named '__builtin__'
Dato che propone una soluzione diversa si può consultare in https://forum.freecadweb.org/viewtopic.php?f=3&t=36983