Problems exporting IFC in FreeCAD 0.19

This forum section is only for IFC-related issues
Post Reply
artyfex
Posts: 6
Joined: Mon Jul 26, 2021 11:55 pm

Problems exporting IFC in FreeCAD 0.19

Post by artyfex »

Hi everyone. I'm Emiliano, from Brazil. I'm new in the community and I'd like some help.

I have a Flathub install of FreeCAD 0.19 on my Linux Mint 20.2, and I cannot export .ifc files.
I receive the following traceback from FreeCAD python terminal:

Code: Select all

>>> import ifcopenshell
Traceback (most recent call last):
  File "/app/lib/python3.8/site-packages/ifcopenshell/__init__.py", line 47, in <module>
    from . import ifcopenshell_wrapper
  File "/app/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "/app/lib/python3.8/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 759, in <module>
    class FileDescription(HeaderEntity):
  File "/app/lib/python3.8/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 783, in FileDescription
    __swig_getmethods__["description"] = description
NameError: name '__swig_getmethods__' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/app/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "/app/lib/python3.8/site-packages/ifcopenshell/__init__.py", line 55, in <module>
    raise ImportError("IfcOpenShell not built for '%s'" % python_distribution)
ImportError: IfcOpenShell not built for 'linux/64bit/python3.8'
The thing is: I have IfcOpenShell installed in my Anaconda directory: /home/emiliano/.anaconda3/lib/python3.8/site-packages/ifcopenshell and when I import ifcopenshell I don't get any traceback from the conda terminal.

I tried sys.path.append("/home/emiliano/.anaconda3/lib/python3.8/site-packages") in FreeCAD terminal, but the traceback persists and the path disappears after I restart FreeCAD.

Can anyone give me a hint of what I can do?
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problems exporting IFC in FreeCAD 0.19

Post by bernd »

It seams your ifcopenshell in Anaconda is not compiled for python 3.8.

you can get the latest binaries from here: https://github.com/IfcOpenBot/IfcOpenSh ... its/master Just click on the newes comment available.

BTW: compiling ifcopenshell does work on most linux distribution right out of the box once the packages are installed.
Last edited by Kunda1 on Tue Jul 27, 2021 10:23 am, edited 1 time in total.
Reason: fixed url
artyfex
Posts: 6
Joined: Mon Jul 26, 2021 11:55 pm

Re: Problems exporting IFC in FreeCAD 0.19

Post by artyfex »

Thanks @bernd for your quick reply.
I was able to fix my problem with the following approach (just in case someone else needs it):

I uninstalled Freecad flathub from Linux Mint package manager and reinstalled it through conda terminal with the commands:

Code: Select all

conda install -c conda-forge freecad
conda install -c conda-forge ifcopenshell
Now it works smoothly :D
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problems exporting IFC in FreeCAD 0.19

Post by bernd »

Ahh, sure as they have the same Python version this works too.

Are you able to post the version you use? I do not know who maintains this build.

Would be interesting to know how old it is, or if it is a 0.19 release version.

AFAIK you could also use the FreeCAD App image. Ifcopenshell might be included there.

cheers bernd
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Problems exporting IFC in FreeCAD 0.19

Post by paullee »

I use AppImage on Fedora, seems Ifcopenshell included there.
artyfex
Posts: 6
Joined: Mon Jul 26, 2021 11:55 pm

Re: Problems exporting IFC in FreeCAD 0.19

Post by artyfex »

These are the versions conda installed in my computer.

FreeCAD info:

OS: Linux Mint 20.2 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: (HEAD detached at 0.19.2)
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.9.2
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United States (en_US)

IFC Open Shell info:
ifcopenshell v0.6.0 py38hb8a4352_3

To tell you the truth, I've never been an "experienced linux user" and I spent a couple years without using the OS, so I fell a bit confused with the way some packages are managed. Back then, apt-get seemed to solve most of my problems :lol:
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problems exporting IFC in FreeCAD 0.19

Post by bernd »

Apart from FreeCAD and IfcOpenShell which I do compile myself, apt-get still solves 99% of my problems.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problems exporting IFC in FreeCAD 0.19

Post by bernd »

Ahh I forgot... For Some python packages I have to use pip, because Debian stable onl has old versions...
Post Reply