ModuleNotFoundError: No module named 'pkg_resources'
Closed this issue · 2 comments
Bug Description
After pip installing phonemizer, importing phonemizer causes the following error:
import phonemizer
Traceback (most recent call last):
File "Python3.12/site-packages/phonemizer/utils.py", line 22, in
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
Phonemizer Version
phonemizer-3.2.1
available backends: segments-2.2.1
uninstalled backends: espeak, espeak-mbrola, festival
System
OS: MacOS Ventura
Python Version: Python 3.12.1
To reproduce
Import phonemizer in a python script
Hi, pkg_resources
is part of setuptools
which is not installed by default in python>=3.12
. To fix this just have a pip install setuptools
.
[note for next release]
To fix this, either add setuptools
in setup.py
dependencies or -- better-- replace pkg_resources
by importlib
.