bootphon / phonemizer

Simple text to phones converter for multiple languages
https://bootphon.github.io/phonemizer/
GNU General Public License v3.0
1.15k stars 163 forks source link

ModuleNotFoundError: No module named 'pkg_resources' #166

Closed lukerbs closed 4 months ago

lukerbs commented 4 months ago

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

mmmaat commented 4 months ago

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.

lukerbs commented 4 months ago

@mmmaat Thank you! Yes, that did the trick for me.