Installation of IfcOpenShell

I decided to collect the information about installing and compiling IfcOpenShell in a new wiki page, IfcOpenShell.

The information in that page existed all over the place in various forum threads, some as old as 2013, so I decided to organize things a bit.

  1. In general, in this day and age (2020), installing IfcOpenShell is easy; the Windows, MacOS, and Linux AppImage distributions of FreeCAD already contain IfcOpenShell, so there is no additional installation necessary; you can start using it immediately. Head to Download.

  2. For other cases, you should use a precompiled version of IfcOpenShell from the IfcOpenBot/IfcOpenShell repository. This is explained in the IfcOpenShell page.

  3. For advanced users, you may compile IfcOpenShell yourself. This isn’t very hard to do, especially if you already have experience compiling FreeCAD from source in Linux (Compile on Linux).

For some reason, the IfcOpenShell project expects as default the “community edition” of OpenCASCADE, abbreviated OCE. I don’t think this is under active maintenance, so normally you would use the “official” OpenCASCADE sources.

wow, very cool wki page! Since it is very detailed, you may post about in os.arch forum and on ifcopenshell forum itself.

cheers bernd

Yes, great job! I’m with bernd, you should post it in osarch forum too!

+1 @vocx
Thank you.

You might also want to notice reader that ifcopenshell is available for some distributions :

Kunda1 showed it nicely (but I don’t know why they are not all visible) in this post

Alike you can get :

This is mentioned in the IfcOpenShell page. “You may install it from your package manager, if it is available.”

However, since IfcOpenShell is still not included in many repositories, I decided to not stress this too much. In any case, using a pre-compiled version is a simple alternative.

Nice. It looks I didn’t read carefully enough. Thanks. And yes I understand your point.

Do you have any installation tips for FreeCAD Snapcraft version?
Wherever I move the precompiled IfcOpenShell folder to any folder in the home/user/snap/freecad path I cannot insert IFC files in FreeCAD.
No modules found!
:exclamation:

Before someone may explain the installation, you may try AppImage version :slight_smile:

https://www.freecadweb.org/thankyou.php?url=https%3A%2F%2Fgithub.com%2FFreeCAD%2FFreeCAD%2Freleases%2Fdownload%2F0.20.1%2FFreeCAD_0.20-1-2022-08-20-conda-Linux-x86_64-py310.AppImage

Yes, it’s better than snapcraft (too close)!
AppImage + putting the ifcopenshell (for python 3.10 64bit Linux) directory with

mv -t $HOME/.local/lib/python3.10/site-packages/ ifcopenshell/

now I import IFC files.
Thx paullee!

To my understanding, IFCopenshell should be built-in in the AppImage, it just work out-of-box for me on Fedora.

On Ubuntu 22.04.1 IfcOpenShell doesn’t work automatically.
BIM Setup show that IfcOpenShell it is not installed.

pMB

kunda1 Any idea ? Thanks.

I think the blenderbim releases contain IfcOpenShell: https://github.com/IfcOpenShell/IfcOpenShell/releases There might be some symlinking/copying to do in order for FreeCAD to find the IfcOpenShell module (basically an ifcopenshell folder with an init.py and other files in it). That folder could for ex. be copied to .local/lib/python/site-packages or .local/share/FreeCAD/Mod, I think the AppImage can find modules there

IfcOpenShell in AppImage


Can someone check the snap ‘edge’ to see if it works as well ?

Anyone can also can test and confirm if IfcOpenShell is contained in AppImage ?

Hello, I don’t know if it possible to install ifcopenshell on a 0.20.1 Linux AppImage, as in this wiki page:

https://wiki.freecadweb.org/IfcOpenShell

Seems to say that is already installed with Appimages and conda packages.

Regards

Carlo D.

I am trying since yesterday to install IfcOpenshell and it’s been quite a struggle. I am not a developer and i try to follow any possible scenario i understand it would work, following this thread and IfcOpenShell wiki mentioned at the first post and several forthcoming links. I use MX-AV linux 10 (buster). uname -r gives: 5.9.1-rt20av. freecad 0.20.1

First of all i tried to update my appimage version through the Properties–>appimage window, since i read that the recent appimage versions come with IfcOpenshell already installed. Although according to this my freecad version should have it installed also. Although i read the arguments that you should choose a version with the IfcOpenShell when installing somehow. Anyway, i receive an error after the new appimage has completed downloading saying: “Update failed for Freecad. The remote server requires authentication to serve the content, but the credentials provided were not accepted or given”.

As a second attempt i try to install pip, since typing “import ifcopenshell” in the freecad’s python console gives me:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/tmp/.mount_FreeCA05xlAq/usr/lib/python3.10/site-packages/shiboken2/files.dir/shibokensupport/feature.py", line 139, in _import
    return original_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'ifcopenshell'

and i understand that i do not have it installed in the system. To install pip, firstly i type "

python -m ensurepip --upgrade

" in teminal which gives me:

ensurepip is disabled in Debian/Ubuntu for the system python.

Python modules For the system python are usually handled by dpkg and apt-get.

    apt-get install python-<module name>

Install the python-pip package to use pip itself.  Using pip together
with the system python might have unexpected results for any system installed
module, so use it on your own risk, or make sure to only use it in virtual
environments.

So i understand that i am pushed by the system to install the pip package. So i follow the second advice of https://pip.pypa.io/en/stable/installation/ webpage and i download the get.pip.py script from the suggested repository and type in terminal:

python get-pip.py

where i get a reply sayong that my system cannot use python 3, so i should install another link of pip (given in terminal reply) which runs on python2. In the beggining i do it and i run it:

Defaulting to user installation because normal site-packages is not writeable
Collecting pip<21.0
  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 1.6 MB/s 
Collecting setuptools<45
  Downloading setuptools-44.1.1-py2.py3-none-any.whl (583 kB)
     |████████████████████████████████| 583 kB 3.8 MB/s 
Collecting wheel
  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: pip, setuptools, wheel

I include this in my report because i also see py3 included and i am not sure what exactly is downloaded and if it should work. After i while i try to see how to download python3 thinking i don’t have it, but looking around my system i understand that it might as well be installed.

Lastly i tried a method shown in blenderbim.org website, downloading a pre-built package and trying to follow the directions, where i downloaded the Python 3.10 “py310-linux64”, since my freecad version uses Python 3.10.6 . But while i try to follow the direction i cannot get access to paste the unziped file to the suggested directory:

$ sudo cp -a /home/spiridonious/Downloads/ifcopenshell/. /tmp/.mount_FreeCA05xlAq/usr/lib/python3.10/site-packages/
[sudo] password for spiridonious: 
cp: failed to access '/tmp/.mount_FreeCA05xlAq/usr/lib/python3.10/site-packages/': Permission denied

So my purpose is to have installed IfcOpenShell as less painfully as possible. Would maybe some of the above mentioned work, doing something more appropriately that i do wrong and i do not understand? Would it work if i uninstall freecad totally and install a newer proper version with IfcOpenShell somehow already truly included?

spiros If you are using AppImage, no need tk separate to install IfcOpenshell.

Try in python console ‘import ifcopenshell’.

Good luck.