Repository: apple/coremltools

Issue #1214: Python 3.9 Support
Created: 2021-06-10T21:14:42Z
5.0b1 appears to have a broken import on macOS with Python 3.9.
~: pip install coremltools==5.0b1
Collecting coremltools==5.0b1
...
Successfully built coremltools
Installing collected packages: coremltools
Successfully installed coremltools-5.0b1
~: python
Python 3.9.5 (default, May  3 2021, 19:12:05) 
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import coremltools
WARNING:root:scikit-learn version 1.0.dev0 is not supported. Minimum required version: 0.17. Maximum required version: 0.19.2. Disabling scikit-learn conversion API.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.9/site-packages/coremltools/__init__.py", line 62, in <module>
    from . import converters
  File "/opt/homebrew/lib/python3.9/site-packages/coremltools/converters/__init__.py", line 7, in <module>
    from . import libsvm
  File "/opt/homebrew/lib/python3.9/site-packages/coremltools/converters/libsvm/__init__.py", line 7, in <module>
    from . import _libsvm_converter
  File "/opt/homebrew/lib/python3.9/site-packages/coremltools/converters/libsvm/_libsvm_converter.py", line 9, in <module>
    from coremltools.models import _METADATA_VERSION, _METADATA_SOURCE
  File "/opt/homebrew/lib/python3.9/site-packages/coremltools/models/__init__.py", line 10, in <module>
    from . import pipeline
  File "/opt/homebrew/lib/python3.9/site-packages/coremltools/models/pipeline.py", line 12, in <module>
    from . import model as _model
  File "/opt/homebrew/lib/python3.9/site-packages/coremltools/models/model.py", line 13, in <module>
    from .utils import _has_custom_layer as _has_custom_layer
  File "/opt/homebrew/lib/python3.9/site-packages/coremltools/models/utils.py", line 20, in <module>
    from ..libmodelpackage import ModelPackage
ModuleNotFoundError: No module named 'coremltools.libmodelpackage'
>>>

Duplicate issue #1210: kernel died
Created: 2021-06-10T00:04:21Z
zsh: illegal hardware instruction  python

Using python 3.9.2. pip install torch==1.8.1 (successful).  pip install coremltools==5.0b1 (successful); python (Python 3.9.2 default);>>> import CoreMLTools resulted with error: zsh: illegal hardware instruction  python
Is this a converter issue? No, likely incompatibility of python 3.9.2 and CoreMLTools (version 4.1 and 5.0b1)

Trace
If applicable, please paste the error trace.  zsh: illegal hardware instruction  python
To Reproduce

If a python script can reproduce the error, please paste the code snippet

# Paste code snippet here
>>> import CoreMLTools
- If applicable, please attach the source model
    - If the model cannot be shared publicly, please attach it via filing a bug report at https://developer.apple.com/bug-reporting/  and provide the reference number here
- If it is a model conversion issue and the conversion succeeds, however, if there is a numerical mismatch between the original and the coreml model, please paste script used for comparison.

## System environment (please complete the following information):
 - coremltools version  (e.g., 3.0b5): 4.1 and 5.0b1
 - OS (e.g., MacOS, Linux): macOS Big Sur
 - macOS version (if applicable): Big Sur
 - XCode version (if applicable):
 - How you install python (anaconda, virtualenv, system): pip install
 - python version (e.g. 3.7): 3.9.2
 - any other relevant information:
     - e.g. keras version if using keras conversion etc.

## Additional context
Add any other context about the problem here.

Closing comment (2021-06-12T00:54:15Z): We don't support Python 3.9 yet.
dup of #1214