Open snej opened 7 months ago
I'm not a Python expert, but I looked up the module imp
and it's been deprecated since Python 3.4, and no longer exists at all in the Python 3.12.1 that Conda installed.
(coremltools-env) $ python --version
Python 3.12.1
(coremltools-env) $ python
Python 3.12.1 | packaged by Anaconda, Inc. | (main, Jan 19 2024, 09:45:58) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import imp
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'imp'
We don't support Python 3.12 yet. That is the root cause here.
Related to #1846
I was able to work around the problem by running conda install python=3.11
-- after that, installing coremltools ran successfully.
If this is considered an enhancement, then the bug is on the Installing CoreML Tools web page -- it should tell people to run conda install python=3.11
before installing coremltools. Otherwise anyone following the directions on that web page is going to run into the same problem I did. Is there a separate repo for the docs where this bug can be filed?
@snej - Right at the top of the document you reference, it says:
The current version of coremltools includes wheels for Python 3.7, 3.8, 3.9, 3.10, and 3.11.
tensorflow 2.16.1 is out supporting 3.12
This was addressed in https://github.com/apple/coremltools/pull/2170 @YifanShenSZ
This was addressed in #2170 @YifanShenSZ
There are several other things that need to be addressed before we can support Python 3.12. At a minimum, we still need to update all of our test dependencies to versions that support Python 3.12
πDescribing the bug
conda install pip
.pip install -U coremltools
the installation failed with a Python exception in the installer:Stack Trace
System environment (please complete the following information):