hcid-courses / datajournalism-2019

서울대학교 데이터 저널리즘 2019 가을학기
https://hcid-courses.github.io/datajournalism-2019/
4 stars 2 forks source link

KoNLPy를 이용한 한글 분석을 하기 위해 java를 다운 받아야하는데 에러가 발생합니다 #2

Open GitHae1337 opened 5 years ago

GitHae1337 commented 5 years ago

실행 환경

Windows 10 + 64 bit + 8GB / Python 3.7.4 / Jupyter Notebook / Java 12.0.2(64bit)

문제 상황

Week 8 - Text Analysis - Lab의 내용을 보면 'KoNLPy를 이용한 한글 분석'에서 '다음의 주소를 참고하여 KoNLPy를 설치하자. http://konlpy.org/en/v0.4.4/'라고 적혀 있어서 위 링크에 들어가 첫 문단에 보면 'For installation directions, see here' (here의 링크: http://konlpy.org/en/v0.4.4/install/) 라고 적혀 있어서 여기서 윈도우에 해당하는 설치 방법에 따라 진행하였습니다.

먼저 JDK를 다시 다운 받았으나 2번의 JAVA Home 세팅을 하는 방법을 어떻게 해야하는지 이해를 잘 못했습니다. 그리고 4번에서 JPype1을 설치하려고 하였는데 계속 cmd 창에 에러가 발생했습니다.

에러 메시지

paste your CMD/python error message here

  1. pip install JPype1-0.5.7-cp27-none-win_amd64.whl 을 입력했을 때 발생하는 에러 메세지 입니다.

C:\Users\Ki Tae Kim>pip install JPype1-0.5.7-cp27-none-win_amd64.whl WARNING: Requirement 'JPype1-0.5.7-cp27-none-win_amd64.whl' looks like a filename, but the file does not exist ERROR: JPype1-0.5.7-cp27-none-win_amd64.whl is not a supported wheel on this platform.

  1. pip install konlpy를 입력했을 때 발생하는 메세지 입니다.

Microsoft Windows [Version 10.0.18362.418] (c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\Ki Tae Kim>pip install konlpy Collecting konlpy Using cached https://files.pythonhosted.org/packages/e5/3d/4e983cd98d87b50b2ab0387d73fa946f745aa8164e8888a714d5129f9765/konlpy-0.5.1-py2.py3-none-any.whl Collecting JPype1>=0.5.7 Using cached https://files.pythonhosted.org/packages/28/63/784834e8a24ec2e1ad7f703c3dc6c6fb372a77cc68a2fdff916e18a4449e/JPype1-0.7.0.tar.gz Installing collected packages: JPype1, konlpy Running setup.py install for JPype1 ... error ERROR: Command errored out with exit status 1: command: 'c:\users\ki tae kim\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\KITAEK~1\AppData\Local\Temp\pip-install-pvgh5l67\JPype1\setup.py'"'"'; file='"'"'C:\Users\KITAEK~1\AppData\Local\Temp\pip-install-pvgh5l67\JPype1\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\KITAEK~1\AppData\Local\Temp\pip-record-rqpqe90q\install-record.txt' --single-version-externally-managed --compile cwd: C:\Users\KITAEK~1\AppData\Local\Temp\pip-install-pvgh5l67\JPype1\ Complete output (54 lines): c:\users\ki tae kim\appdata\local\programs\python\python37-32\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'use_scm_version' warnings.warn(msg) running install running build running build_py creating build creating build\lib.win32-3.7 creating build\lib.win32-3.7\jpype copying jpype\beans.py -> build\lib.win32-3.7\jpype copying jpype\imports.py -> build\lib.win32-3.7\jpype copying jpype\nio.py -> build\lib.win32-3.7\jpype copying jpype\reflect.py -> build\lib.win32-3.7\jpype copying jpype\types.py -> build\lib.win32-3.7\jpype copying jpype_classpath.py -> build\lib.win32-3.7\jpype copying jpype_core.py -> build\lib.win32-3.7\jpype copying jpype_cygwin.py -> build\lib.win32-3.7\jpype copying jpype_darwin.py -> build\lib.win32-3.7\jpype copying jpype_gui.py -> build\lib.win32-3.7\jpype copying jpype_jarray.py -> build\lib.win32-3.7\jpype copying jpype_jboxed.py -> build\lib.win32-3.7\jpype copying jpype_jclass.py -> build\lib.win32-3.7\jpype copying jpype_jcollection.py -> build\lib.win32-3.7\jpype copying jpype_jcomparable.py -> build\lib.win32-3.7\jpype copying jpype_jcustomizer.py -> build\lib.win32-3.7\jpype copying jpype_jexception.py -> build\lib.win32-3.7\jpype copying jpype_jinit.py -> build\lib.win32-3.7\jpype copying jpype_jio.py -> build\lib.win32-3.7\jpype copying jpype_jobject.py -> build\lib.win32-3.7\jpype copying jpype_jpackage.py -> build\lib.win32-3.7\jpype copying jpype_jproxy.py -> build\lib.win32-3.7\jpype copying jpype_jstring.py -> build\lib.win32-3.7\jpype copying jpype_jtypes.py -> build\lib.win32-3.7\jpype copying jpype_jvmfinder.py -> build\lib.win32-3.7\jpype copying jpype_linux.py -> build\lib.win32-3.7\jpype copying jpype_pykeywords.py -> build\lib.win32-3.7\jpype copying jpype_windows.py -> build\lib.win32-3.7\jpype copying jpype__init__.py -> build\lib.win32-3.7\jpype running build_ext running build_java Using Jar cache creating build\lib creating build\lib\org creating build\lib\org\jpype creating build\lib\org\jpype\classloader copying native\jars\org\jpype\classloader\JPypeClassLoader.class -> build\lib\org\jpype\classloader copying native\jars\org.jpype.jar -> build\lib running build_thunk Building thunks C:\Users\KITAEK~1\AppData\Local\Temp\pip-install-pvgh5l67\JPype1\setupext\build_ext.py:85: FeatureNotice: Turned ON Numpy support for fast Java array access FeatureNotice) including thunk build\lib\org\jpype\classloader\JPypeClassLoader.class including thunk build\lib\org.jpype.jar building '_jpype' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

ERROR: Command errored out with exit status 1: 'c:\users\ki tae kim\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\KITAEK~1\AppData\Local\Temp\pip-install-pvgh5l67\JPype1\setup.py'"'"'; file='"'"'C:\Users\KITAEK~1\AppData\Local\Temp\pip-install-pvgh5l67\JPype1\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\KITAEK~1\AppData\Local\Temp\pip-record-rqpqe90q\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

스크린샷

2019-10-24 15_50_50-명령 프롬프트 확실하지 않아 자바 버젼 확인한 것 스크린샷 첨부합니다.

2019-10-24 16_05_25-명령 프롬프트 pip install JPype1-0.5.7-cp27-none-win_amd64.whl 을 입력했을 때 발생하는 에러 메세지 입니다.

2019-10-24 16_05_50-명령 프롬프트 2019-10-24 16_05_56-명령 프롬프트

pip install konlpy를 입력했을 때 발생하는 메세지입니다. 에러 메세지가 길어서 두개의 첨부파일로 나눠서 스크린샷 찍었습니다.

eqo295 commented 5 years ago
  1. Jpype-1 설치가 원활하지 않을 경우 "파일을 다운로드 받아 직접 설치"해야 합니다.

아래 링크에서 "지금 컴퓨터 환경과 파이썬 버전과 일치하는" 파일을 다운로드 받아 수동 설치합니다.

(https://www.lfd.uci.edu/~gohlke/pythonlibs/?source=post_page-----d6677a88d25e----------------------#jpype)

위 과정이 어려울 경우 아래 참고 포스팅을 확인해 주시길 바랍니다.

https://medium.com/@art.and.play.7/%EB%B9%84%EC%A0%84%EA%B3%B5%EC%9E%90%EB%A5%BC-%EC%9C%84%ED%95%9C-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EA%B3%BC%ED%95%99-%EC%A4%80%EB%B9%84%EA%B3%BC%EC%A0%95-%EC%BD%94%EB%94%A9%ED%8E%B8-3-pip-conda%EB%A1%9C-%ED%99%95%EC%9E%A5-%EA%B8%B0%EB%8A%A5-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-d6677a88d25e