Polyglot seems installed, but can't run a simple test script from the official documentation.
I am running Python 3.9 on Windows 10 on a 64-bit machine. I used pip (pip install <package>
) to install pycld2-0.41-cp39-cp39-win_amd64.whl
and PyICU-2.6-cp39-cp39-win_amd64.whl
from https://www.lfd.uci.edu/~gohlke/pythonlibs/, and also installed numpy (pip install numpy
).
Here is my script (taken from https://polyglot.readthedocs.io/en/latest/Detection.html):
from polyglot.detect import Detector
from polyglot.utils import pretty_list
print(pretty_list(Detector.supported_languages()))
The output is
Traceback (most recent call last):
File "C:\Users\briggs_w\Desktop\testPolyglot.py", line 3, in <module>
print(pretty_list(Detector.supported_languages()))
File "C:\Program Files\Python39\lib\site-packages\polyglot\utils.py", line 72, in pretty_list
lang = lang.decode(u"utf-8")
AttributeError: 'str' object has no attribute 'decode'
So I don't know if I'm missing a library, but googling isn't getting me anything about how this error relates to polyglot's code.