Closed
Description
🐞Describing the bug
- I'm following the directions at "Installing Core ML Tools".
- I went through "Set Up Conda": created the virtual environment, ran
conda install pip
. - Then when I ran
pip install -U coremltools
the installation failed with a Python exception in the installer:
(coremltools-env) $ pip install -U coremltools
Collecting coremltools
Downloading coremltools-7.1.tar.gz (1.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 6.2 MB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/7d/hl3k4nxj5_72y9dcxt0brwwm0000gp/T/pip-install-te23914i/coremltools_7669cbec5c1f436d949cfe9db26f0157/setup.py", line 8, in <module>
import imp
ModuleNotFoundError: No module named 'imp'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Stack Trace
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/7d/hl3k4nxj5_72y9dcxt0brwwm0000gp/T/pip-install-te23914i/coremltools_7669cbec5c1f436d949cfe9db26f0157/setup.py", line 8, in <module>
import imp
ModuleNotFoundError: No module named 'imp'
System environment (please complete the following information):
- Conda 23.11.0
- Python 3.12.1 (installed by Conda)
- macOS Sonoma 14.2.1
- MacBook Pro 16", 2021 (M1 Pro, 32GB RAM)