Can't Import ifcopenshell on MacOS

This forum section is only for IFC-related issues
Post Reply
moonlikestone
Posts: 3
Joined: Mon Sep 03, 2018 4:45 am

Can't Import ifcopenshell on MacOS

Post by moonlikestone »

I tried to import ifcopenshell in FreeCAD, and I follow the steps of the tutorial in this forum:https://forum.freecadweb.org/viewtopic.php?t=17536

In the Final step,when I run:

Code: Select all

import ifcopenshell
into the FreeCAD python console, I get the import error:

Code: Select all

Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/lib/python2.7/site-packages/ifcopenshell/__init__.py", line 45, in <module>
    from . import ifcopenshell_wrapper
  File "/Applications/FreeCAD.app/Contents/lib/python2.7/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 28, in <module>
    _ifcopenshell_wrapper = swig_import_helper()
  File "/Applications/FreeCAD.app/Contents/lib/python2.7/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 24, in swig_import_helper
    _mod = imp.load_module('_ifcopenshell_wrapper', fp, pathname, description)
ImportError: dlopen(/Applications/FreeCAD.app/Contents/lib/python2.7/site-packages/ifcopenshell/_ifcopenshell_wrapper.so, 2): Symbol not found: _PyBytes_AsStringAndSize
  Referenced from: /Applications/FreeCAD.app/Contents/lib/python2.7/site-packages/ifcopenshell/_ifcopenshell_wrapper.so
  Expected in: flat namespace
 in /Applications/FreeCAD.app/Contents/lib/python2.7/site-packages/ifcopenshell/_ifcopenshell_wrapper.so
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Applications/FreeCAD.app/Contents/lib/python2.7/site-packages/ifcopenshell/__init__.py", line 52, in <module>
    raise ImportError("IfcOpenShell not built for '%s'" % python_distribution)
ImportError: IfcOpenShell not built for 'darwin/64bit/python2.7'
My MacOS version is 10.13.6, FreeCAD version is 0.17 64bit, and python version is 2.7.15.
How to solve this error in my MacOS?

Thanks!!!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Can't Import ifcopenshell on MacOS

Post by Kunda1 »

When asking for support please always post your full Help > About FreeCAD > Copy to clipboard
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
moonlikestone
Posts: 3
Joined: Mon Sep 03, 2018 4:45 am

Re: Can't Import ifcopenshell on MacOS

Post by moonlikestone »

Here are the information about my system and FreeCAD

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13519 (Git)
Build type: Release
Branch: (HEAD detached at 1a8b868)
Hash: 1a8b868018f45ea486c0023fdbfeb06febc1fb89
Python version: 2.7.14
Qt version: 5.10.1
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Chinese/Taiwan (zh_TW)

Thank for your remind!
And.... How to install ifcopenshell in my system?
Post Reply