상세 컨텐츠

본문 제목

20220212파이썬 수업

<개인공부>

by 데브수달 2022. 2. 12. 10:28

본문

728x90
반응형

https://bces.tistory.com/27 - konlpy 설치 오류 해결법

*KONLP 설치시 오류
 konlp와 jpype1이 서로 버전이 맞아야 함. 

 파이썬3.9버젼  ->1.3 
 konlp -> 1.2버전을 요구함.
 
 맞출려면 파이썬 버전을 낮춰야하는데, 그게 아닌 경우에는 
konlp가 버전을 맞추라.

대안: 순서를 바꿔라!!! 
jpype1 먼저 설치 후 konlp를 설치한다.

-----------------------------------------------------------------------------
cmd 확실하게 알기위해  (이게 안되면 아나콘다 cmd)
권리자 권한 열기 
>>> pip install konlpy

>>>conda install -c conda-forge jpype1

>>>y

>>>pip install konlpy

>>>python (파이썬 테스트)

>>>from konlpy.tag import Kkma

>>>from konlpy.utils import pprint

>>> Kkma = Kkma()
>>> pprint(Kkma.sentences(u'네, 안녕하세요, 반갑습니다..'))

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

C:\WINDOWS\system32>pip install konlpy
Collecting konlpy
  Downloading konlpy-0.6.0-py2.py3-none-any.whl (19.4 MB)
     |████████████████████████████████| 19.4 MB ...
Requirement already satisfied: numpy>=1.6 in c:\users\502-8\anaconda3\lib\site-packages (from konlpy) (1.20.3)
Requirement already satisfied: lxml>=4.1.0 in c:\users\502-8\anaconda3\lib\site-packages (from konlpy) (4.6.3)
Requirement already satisfied: JPype1>=0.7.0 in c:\users\502-8\anaconda3\lib\site-packages (from konlpy) (1.3.0)
Installing collected packages: konlpy
Successfully installed konlpy-0.6.0

C:\WINDOWS\system32>conda install -c conda-forge jpype1
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\502-8\anaconda3

  added / updated specs:
    - jpype1


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    jpype1-1.3.0               |   py39h2e07f2f_2         389 KB  conda-forge
    ------------------------------------------------------------
                                           Total:         389 KB

The following NEW packages will be INSTALLED:

  jpype1             conda-forge/win-64::jpype1-1.3.0-py39h2e07f2f_2


Proceed ([y]/n)? y


Downloading and Extracting Packages
jpype1-1.3.0         | 389 KB    | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

C:\WINDOWS\system32>pip install konlpy
Requirement already satisfied: konlpy in c:\users\502-8\anaconda3\lib\site-packages (0.6.0)
Requirement already satisfied: lxml>=4.1.0 in c:\users\502-8\anaconda3\lib\site-packages (from konlpy) (4.6.3)
Requirement already satisfied: JPype1>=0.7.0 in c:\users\502-8\anaconda3\lib\site-packages (from konlpy) (1.3.0)
Requirement already satisfied: numpy>=1.6 in c:\users\502-8\anaconda3\lib\site-packages (from konlpy) (1.20.3)

C:\WINDOWS\system32>python
Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated.  Libraries may fail to load.  To activate this environment
please see https://conda.io/activation

Type "help", "copyright", "credits" or "license" for more information.
>>> from konlpy.tag import Kkma
>>> from konlpy.utils import pprint
>>> Kkma = Kkma()
>>> pprint(Kkma.sentences(u'네, 안녕하세요,반갑습니다..'))
['네, 안녕 하세요, 반갑습니다..']
>>>



이게 안되는 경우 아나콘다cmd에서!!

*형태소 https://mr-doosun.tistory.com/22 참고!
1개만 해봤을 때 되면 5개 형태소 다 되는 것.

----------------------------------------------------------------------

*파이썬 시각화 (파이썬 구글맵을 못쓴다/ 맵을 공짜로 쓰게해주는 곳이 있다)
1.맵플롯 -기본 시각화
2.시본(searbon)  -고급 시각화
https://seaborn.pydata.org/index.html
3.보케 -출력을 웹으로 
https://ichi.pro/ko/sigaghwaleul-wihan-6-gaji-python-laibeuleoli-eotteon-geos-eul-sayonghalkkayo-279564657677912
4. mapboxgl -지도시각화
https://docs.mapbox.com/help/tutorials/
(조건: 가입/ 인정코드 받아야함.)
https://www.mapbox.com/

사이트별로 튜토리얼을 보면서 공부하면 된다! (번역해서)

웹 장고 배우지 말 것.
장고는 파이썬만 가능해서 
리액트, 뷰제이 등 프리하게 
https://d3js.org/

프로그램를 알아보고 딱 쓸만한 것들만 집중해서 공부하기 

----------------------------------

 

*업무 자동화

이전: macro -> 반복적인 작업을 일괄처리.

지금:RPA -> 반복적인 업무를 대신함. -복합성

 

https://www.redhat.com/k

셀레니움
https://luminitworld.tistory.com/90
셀레니움 명령어 모음집
https://pythondocs.net/selenium/셀레니움-크롤러-기본-사용법

*셀레니움 설치
https://chancoding.tistory.com/136

크롬 버전 98.0.4758.82

chrome_drv

*예외처리
try:

exception: 
exception:
....
final:

크롤링에 관심 가지기 !!

1.python은 라이브러리 설치해야하지만,
2.anaconda는 기본적인 라이브러리모두 설치되어있음.
(예외적인 추가 내용에 대해서만 설치하면 됨)
3.코랩:예외적인 라이브러리 실행시 마다 설치해야 함.

*코딩법
1.카멜->현재진행형...
2.스내이크 ->DOS
3.헝가리안 -> Windows95

728x90
반응형

관련글 더보기