Importing coremltools in the new 4.0b3 release causes a ModuleNotFoundError.
Traceback (most recent call last):
File "main.py", line 1, in <module>
import coremltools as ct
File "env/lib/python3.7/site-packages/coremltools/__init__.py", line 54, in <module>
from . import converters
File "env/lib/python3.7/site-packages/coremltools/converters/__init__.py", line 7, in <module>
from . import libsvm
File "env/lib/python3.7/site-packages/coremltools/converters/libsvm/__init__.py", line 8, in <module>
from . import _libsvm_converter
File "env/lib/python3.7/site-packages/coremltools/converters/libsvm/_libsvm_converter.py", line 7, in <module>
from ..._deps import _HAS_LIBSVM
File "env/lib/python3.7/site-packages/coremltools/_deps/__init__.py", line 15, in <module>
from packaging import version
ModuleNotFoundError: No module named 'packaging'
virtualenv env
source env/bin/activate
pip install coremltools-4.0b3-cp37-none-macosx_10_15_intel.whl
In main.py:
import coremltools as ct
The ModuleNotFoundError occurs when importing coremltools.
This problem does not happen with the 4.0b2 wheel, only the 4.0b3 wheel.
@willbattel installing packaging module resolve this. We will add this as a dependency
@srikris Can you add packaging module dependency to setup.py?
packaging module is used in https://github.com/apple/coremltools/blob/94737631ebef98fddd9351057bfc4f2f8f626349/coremltools/_deps/__init__.py#L15
@srikris Can you add
packagingmodule dependency tosetup.py?
packagingmodule is used in
Will make sure to include this in next release, thanks!
what should I do before this gets fixed?
Is there a manual way too add the dependancy of packaging as an work around. I am running 4.0b3 and would like to be able to import coremltools.
what should I do before this gets fixed?
Is there a manual way too add the dependancy of packaging as an work around. I am running 4.0b3 and would like to be able to import coremltools.
You can install packaging yourself. For example, if using pip, simply pip install packaging.
thanks and that worked
This issue has been fixed and will include in the next release. Thanks!
Fixed with coremltools 4.0b4
Most helpful comment
@willbattel installing packaging module resolve this. We will add this as a dependency