nlpub/pymystem3

Windows + Python 3.4

alexanderpanchenko opened this issue · 1 comments

Вот такая ошибка возникает при попытке запустить стандартный пример из документации

C:\Python34>python.exe Scripts\test.py> test_py.out
Traceback (most recent call last):
File "Scripts\test.py", line 4, in
lemmas = m.lemmatize(text)
File "C:\Python34\lib\site-packages\pymystem3\mystem.py", line 235, in lemmati
ze
infos = self.analyze(text)
File "C:\Python34\lib\site-packages\pymystem3\mystem.py", line 220, in analyze

result.extend(self._analyze_impl(line))

File "C:\Python34\lib\site-packages\pymystem3\mystem.py", line 285, in analyz
e_impl
obj = json.loads(out)
File "C:\Python34\lib\json__init
_.py", line 312, in loads
s.class.name))
TypeError: the JSON object must be str, not 'bytes'

find

try:
    obj = json.loads(out)
except (IOError, ValueError):
    raise RuntimeError("Problem has been occured. Current state:\ntext:\n%s\nout:\n%s" %
                                   (text, out))
return obj 

in mystem.py
and replace
obj = json.loads(out)
with
obj = json.loads(out.decode('utf-8'))