cadquery
cadquery copied to clipboard
Installing CadQuery with Pip3 on arm64 Apple M1
Just posting this here for future reference, as I couldn't find this solution anywhere in the README or in past issues on this topic.
I was able to install cadquery on my M1 Mac using the following steps:
- Make sure Xcode command line tools and Python3 are installed (assuming you are not using *conda)
- Upgrade pip like
python3 -m pip install --upgrade pip
- Add the following
requirements.txt
to your project:
cadquery
cadquery-ocp == 7.7.1
pyparsing >= 2.1.9
sphinx == 5.0.1
sphinx_rtd_theme
black == 19.10b0
click == 8.0.4
mypy
codecov
pytest
pytest-cov
ezdxf
typing_extensions
nptyping == 2.0.1
nlopt
path
casadi
multimethod >= 1.7,<2.0
typish
- Install the intel versions of these packages:
arch -arch x86_64 pip3 install -r requirements.txt
- Run the intel version of cadquery and check that it's working:
arch -arch x86_64 python3
>>> import cadquery
>>> cadquery.Workplane('XY').box(1,2,3).toSvg()
I think the "better" way to do this is to use https://github.com/CadQuery/ocp-build-system to extract a python wheel from conda, which involves installing M1 OCP from conda and then extracting the wheel using python setup.py bdist_wheel
. This method should have much better performance
Thank you @akoen! Followed your suggestion and it worked after a while. Had to build wheel for nlopt as well since that didn't have pypi dist for arm64 either.
I published the resulting wheels and some instructions on how to use them with poetry here: https://github.com/biggestT/cadquery-dist-macos-arm64
at least the cadquery.Workplane('XY').box(1,2,3).toSvg()
works now
Awesome, great work!