Closed snoop2head closed 3 years ago
Hello. You can solve this problem by following these steps:
Open jvm.py
file.
It depends on the user and environment, but you can check the location of jvm.py
in the log.
In your case, jvm.py
is located ~/.pyenv/versions/nlpkor2/lib/python3.8/site-packages/konlpy/jvm.py
.
Modify lines 66-67 as follows:
~/.pyenv/versions/nlpkor2/lib/python3.8/site-packages/konlpy/jvm.py in init_jvm(jvmpath, max_heap_size)
62
63 if jvmpath:
64 jpype.startJVM(jvmpath, '-Djava.class.path=%s' % classpath,
65 '-Dfile.encoding=UTF8',
- 66 '-ea', '-Xmx{}m'.format(max_heap_size),
- 67 convertString=True)
+ 66 '-ea', '-Xmx{}m'.format(max_heap_size))
convertStrings
(bool) – Option to force Java strings to cast to Python strings. This option is to support legacy code for which conversion of Python strings was the default. This will globally change the behavior of all calls using strings, and a value of True is NOT recommended for newly developed code.
You can see more information about convertString
and TypeError
from JPype User Guide and API Reference.
Seems like the issue has been resolved within a year...! The recent version works fine on my local dev environment. Thanks for the walk through!
Situation
Problem