Closed KeithSloan closed 2 years ago
According your logs you are using Python 3.8, but the rhino3dm module you're loading is for Python 3.9 - that will not work, you need to have the correct version installed.
The Python 3.8 version of rhino3dm for MacOS (Intel) is https://files.pythonhosted.org/packages/0e/4d/65a142a09099807df640479585467751df9f1cc26851039ef05f718e8ab6/rhino3dm-7.11.1-cp38-cp38-macosx_11_0_x86_64.whl
Note that we don't have Apple Silicon compatible builds yet.
Okay (Although it says experimental) I can see what versions are available to install with pip using pip index versions rhino3dm Is there some way/where I can check which versions go with which python?
I am trying to document the install requirements for my FreeCAD workbench that uses rhino3dm. FreeCAD runs on Windows, Linux, MacOS and different versions of FreeCAD use different versions of Python. It is not very satisfactory to have specific links to wheels.
I just tried installing 7.6.0 and then 0.16.0 and still have the same problem.
I am not sure why you are trying older builds instead of the new that I linked. 7.11.0 is current most up-to-date.
To install the rhino3dm for the correct version you'll have to use the same Python version as used if FreeCAD, in your case on MacOS that would be Python 3.8. I believe at the moment Python 3 would default to Python 3.9, so you'll have to ensure you use pip
that goes with the correct Python version 3.8.
I was trying older versions as I thought they might have been built with older python.
Okay I tried
python3.8 -m ensurepip --default-pip
pip install -t /Applications/FreeCAD_19.2.app/Contents/Resources/lib/python3.8/site-packages rhino3dm --upgrade --force
Collecting rhino3dm
Using cached rhino3dm-7.7.0-cp39-cp39-macosx_10_15_x86_64.whl (3.7 MB)
Installing collected packages: rhino3dm
Still does not work.
Okay I got it to work with
python3.8 -m pip install -t /Applications/FreeCAD_19.2.app/Contents/Resources/lib/python3.8/site-packages rhino3dm --upgrade --force
Collecting rhino3dm
Downloading rhino3dm-7.7.0-cp38-cp38-macosx_10_15_x86_64.whl (3.7 MB)
|████████████████████████████████| 3.7 MB 5.2 MB/s
Installing collected packages: rhino3dm
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /private/var/folders/cj/z259fmwd41dgzl8mq8nppwd40000gn/T/pip-target-c7__qqn1/include/python/UNKNOWN
sysconfig: /private/var/folders/cj/z259fmwd41dgzl8mq8nppwd40000gn/T/pip-target-c7__qqn1/include/python
WARNING: Additional context:
user = False
home = '/private/var/folders/cj/z259fmwd41dgzl8mq8nppwd40000gn/T/pip-target-c7__qqn1'
root = None
prefix = None
Successfully installed rhino3dm-7.7.0
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /private/var/folders/cj/z259fmwd41dgzl8mq8nppwd40000gn/T/pip-target-c7__qqn1/include/python/UNKNOWN
sysconfig: /private/var/folders/cj/z259fmwd41dgzl8mq8nppwd40000gn/T/pip-target-c7__qqn1/include/python
But lots of WARNINGS
So this now works for you in FreeCAD on MacOS as well?
Yes using the last approach.
Are the warnings okay to ignore?
They look like warnings from PIP, not from our code. You could report it to the link mentioned in the log.
So yes, I think it is safe to ignore these warnings from rhino3dm point of view.
I have tried to install rhino3dm in a library where FreeCAD will find it with
But import rhino3dm fails with
init.py looks like
And the directory does not contain any such files