Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: Java package 'kr.lucypark.okt' is not valid #422

Open
CherinaS opened this issue Mar 6, 2023 · 0 comments
Open

AttributeError: Java package 'kr.lucypark.okt' is not valid #422

CherinaS opened this issue Mar 6, 2023 · 0 comments

Comments

@CherinaS
Copy link

CherinaS commented Mar 6, 2023

cmd창에서 python을 사용하여 konlpy 형태소 분석을 실시하려고 합니다.
Okt를 사용하는 과정에서 다음과 같은 에러코드가 발생합니다.

AttributeError Traceback (most recent call last)
Cell In[26], line 3
1 #twitter 형태소 분석기
2 from konlpy.tag import Okt
----> 3 okt = Okt()

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\konlpy\tag_okt.py:54, in Okt.init(self, jvmpath, max_heap_size)
51 jvm.init_jvm(jvmpath, max_heap_size)
53 oktJavaPackage = jpype.JPackage('kr.lucypark.okt')
---> 54 OktInterfaceJavaClass = oktJavaPackage.OktInterface
55 self.jki = OktInterfaceJavaClass()
56 self.tagset = utils.read_json('%s/data/tagset/twitter.json' % utils.installpath)

환경변수 설정도 완료했고 java path도 확인을 마쳤습니다.

javadir : C:\Users\user\AppData\Local\Programs\Python\Python39\Lib\site-packages\konlpy\java
os.sep :
classpath: C:\Users\user\AppData\Local\Programs\Python\Python39\Lib\site-packages\konlpy\java\open-korean-text-2.1.0.jar

현재 사용하고 있는 파이썬은 3.9.12(3.8로 다운그레이드도 시도해보았으나 에러 결과는 같았습니다)
set JAVA_HOME결과 JAVA_HOME=C:\Program Files\Java\jdk-17\bin\server으로 나타났습니다.

어떻게 해결할 수 있을까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant