pip install ifcopenshell?

Noob question here. Is ifcopenshell also distributed via 'pip'? Or can I only download it through the website and/or github?

Comments

  • No, ifcopenshell is not currently available on pypi.

  • @Cyril said:
    No, ifcopenshell is not currently available on pypi.

    Thanks, for the quick reply.

  • Ping @krande who helped distribute bcf on pip and @aothms - how hard would it be to provide a pip install?

  • You can use conda https://github.com/IfcOpenShell/IfcOpenShell/issues/1327

    Conda is a bit more intended for binary packages and our dependencies OCCT / pythonocc are already on it. That's the main rationale.

    IfcOpenShell has a slow build process on an external machine, so it's not as easy as simple github action.

    In addition to uploading to S3, it won't be too difficult to upload to pypi as well I guess? @krande? https://github.com/IfcOpenShell/IfcOpenBot/blob/master/upload.py It's a bit of a pain to develop and test though.

  • It is definitively possible to make a pypi release using github actions, but it is not necessarily straight forward. In my experience with packaging adapy using pip (which depends on icopenshell, pythonocc-core ++) I ran into issues with having dependencies split between pypi and conda-forge forcing me to install packages separately using conda. That resulted in a somewhat unpredictable state where I sometimes encountered dll-errors when some of the dependent packages was updated either on the conda or pip side. Ultimately I ended up creating conda packages for the pip packages not on conda so that the entire list of dependencies could be installed in a single "conda install" operation.

    So to summarize, I think it should be doable, but it could potentially require re-packaging some of the "conda-only" dependencies using pip or include it in the pip wheel somehow (which I don't have any experience with).

  • "conda-only" dependencies

    Note that when using the IfcOpenShell IfcOpenBot script everything is statically linked, because of these issues. Not ideal either in different ways..

  • edited October 2021

    @aothms said:
    IfcOpenShell has a slow build process on an external machine, so it's not as easy as simple github action.

    This is what I did for python-fcl. cibuilwheel is intended to help with this. See : https://github.com/CyrilWaechter/python-fcl/blob/master/.github/workflows/push.yml

  • I am getting confused,

    In the Blender API when I import ifcopenshell it works. But it's a third party module. I have BlenderBIM installed, does it come with that?
    For example when I want to use the modules xlsxwriter, lxml it works in the Blender API, does it mean Blender uses my system installed Python?

  • @Coen said:
    I am getting confused,

    In the Blender API when I import ifcopenshell it works. But it's a third party module. I have BlenderBIM installed, does it come with that?
    For example when I want to use the modules xlsxwriter, lxml it works in the Blender API, does it mean Blender uses my system installed Python?

    On Manjaro Linux for example yes it is using system python interpreter. To know if it is you case you can type this in Blender's scripting console :

    import sys
    sys.executable
    

    In my case, output is '/usr/bin/python3.9'

    Coen
  • On linux platforms, it depends on the install method. If you download from blender.org, then the python interpreter is bundled one, if you setup using package manager, it should default to system interpreter.

  • @Coen regardless of how Blender is installed (downloaded or via package manager), Blender adds a few extra paths to its system path - one of those being the paths for addon modules. The BlenderBIM Add-on takes advantage of this and bundles a bunch of dependencies with it. It's not following the Unix tradition, but it is a good way to ensure that users get exactly what we need them to have, especially during alpha stage where dependencies keep on changing. So - it uses whatever Python you have, but with an additional module path with modules that the BlenderBIM Add-on ships (assuming you download the add-on from the BlenderBIM Add-on website, as opposed to doing a custom install).

    You can find these modules in /path/to/blender/addons/dir/blenderbim/libs/site/packages/.

    Coen
  • It is finally available on the pip!
    https://pypi.org/project/python-ifcopenshell/
    Note it works only with python 3.9.

    Gorgious
  • @BTokarzewski that looks a little suspicious, since it's version v0.6.0 which is quite a bit outdated. There's been efforts by @krande and @aothms in getting an Anaconda build going. Will that help? https://github.com/IfcOpenShell/IfcOpenShell/pull/2132

Sign In or Register to comment.