I have been using FreeCad through the UI without problems, but now I want to automate some jobs and write python scripts for that.
My System:
OS: macOS 12.0.1 (M1 Chip)
Word size of FreeCAD: 64-bit
Version: 0.21.2.33771 (Git)
Build type: Release
Branch: (HEAD detached at 0.21.2)
Python 3.10.13, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.6, OCC 7.6.3
Locale: C/Default (C)
However I can’t get FreeCad to work, when I try to import FreeCad it fails….
Code:
FREECADPATH = "/Applications/FreeCAD.app/Contents/Resources/lib"
import sys
sys.path.append(FREECADPATH)
import FreeCAD
import Part
import Mesh
Error:
ImportError
Traceback (most recent call last)
/var/folders/xq/3swyh0t579s290dpc98gf4v00000gn/T/ipykernel_16926/1691855307.py in <module>
4 sys.path.append(FREECADPATH)
5
----> 6 import FreeCAD
7 import Part
8 import Mesh
ImportError: dlopen(/Applications/FreeCAD.app/Contents/Resources/lib/FreeCAD.so, 0x0002): tried: '/Applications/FreeCAD.app/Contents/Resources/lib/FreeCAD.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/FreeCAD.so' (no such file), '/usr/lib/FreeCAD.so' (no such file)
Has anyone managed to use FreeCad in python scripts on Apple M1 processor? What should I do to make it work?
Thank You