일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- pytorch
- GCP
- OpenAI
- ML
- GPT API
- BitCoin
- NLP
- CentOS
- ML #머신러닝
- GPU
- Gunicorn
- 고유값
- Flask
- python
- vram
- overloaed
- onnx #openvino #tf2onnx #openvinokeras
- docker
- Backoff
- Python #open #read #파이썬
- Python #for문 #while문 #응애
- MySQL
- Anaconda
- GPT
- leetcode
- DataLoader
- Mecab
- 매매봇
- UUID
- 파이썬 #기초 #응애
- Today
- Total
람쥐썬더
[Windows] Exception: The MeCab dictionary does not exist at "/usr/local/lib/mecab/dic/mecab-ko-dic". Is the dictionary correctly installed? 해결 본문
[Windows] Exception: The MeCab dictionary does not exist at "/usr/local/lib/mecab/dic/mecab-ko-dic". Is the dictionary correctly installed? 해결
람쥐썬더123 2023. 5. 11. 11:49윈도우에서 Mecab을 사용하기 위해 설치하는 과정은 다음과 같다
1. c 드라이브에 mecab 폴더 만들기
2. Mecab-ko-msvc 다운로드
https://github.com/Pusnow/mecab-ko-msvc/releases/tag/release-0.9.2-msvc-3
Release release-0.9.2-msvc-3 · Pusnow/mecab-ko-msvc
Fix: -r 옵션을 지정해 주지 않았을 때 레지스트리에서 이상한 값을 가져와 오류가 나는 문제 해결
github.com
3. mecab-ko-dic-msvc 다운로드
https://github.com/Pusnow/mecab-ko-dic-msvc/releases/tag/mecab-ko-dic-2.1.1-20180720-msvc
Release mecab-ko-dic-2.1.1-20180720-msvc · Pusnow/mecab-ko-dic-msvc
mecab-ko-dic-2.1.1-20180720 반영 오류 수정 NNG/장소의 출현 비용이 비정상적으로 높았던 문제(학습 데이터) 수정 후 재학습 사전 오피스/NNG/장소 추가
github.com
4. 두 파일 c:/mecab 에서 압축 풀어주기
5. Python 버전에 맞춰 whl 파일 설치하기
https://github.com/Pusnow/mecab-python-msvc/releases/tag/mecab_python-0.996_ko_0.9.2_msvc-2
Release mecab_python-0.996_ko_0.9.2_msvc-2 · Pusnow/mecab-python-msvc
Add Python 3.7 support
github.com
6. whl 파일을 가상환경 site-packages에 넣어주고 install 해주기
pip install ~~~.whl
7. mecab import 후 실행
from konlpy.tag import Mecab
mecab = Mecab()
근데 에러 뜸
사전 설치 했냐고 물어보는건데 위에서 설치 해줬는데 왜 안되징?
보니까 mecab 동작 할때 설정된 경로가 리눅스 경로인 'usr/local/lib/mecab/dic/mecab-ko-dic' 으로 되어 있다
해결
from konlpy.tag import Mecab
mecab = Mecab(dicpath = 'c:/mecab/mecab-ko-dic')
///
def __init__(self, dicpath='c:/mecab/mecab-ko-dic'):
self.dicpath = dicpath
try:
self.tagger = Tagger('-d %s' % dicpath)
self.tagset = utils.read_json('%s/data/tagset/mecab.json' % utils.installpath)
except RuntimeError:
raise Exception('The MeCab dictionary does not exist at "%s". Is the dictionary correctly installed?\nYou can also try entering the dictionary path when initializing the Mecab class: "Mecab(\'/some/dic/path\')"' % dicpath)
except NameError:
raise Exception('Install MeCab in order to use it: http://konlpy.org/en/latest/install/')
dicpath 를 mecab 설치한 경로로 바꿔주면 된다.
아니믄 init 파일에서 수정해줘도 됨
'에러' 카테고리의 다른 글
[CENTOS] centos 7.9 , MySQL 5.7 설치 에러 (0) | 2023.12.20 |
---|---|
TypeError: Input type float32 is not supported (0) | 2023.04.07 |
[LINUX] Permissions 0777 , 0555 ON WINDOWS10 (0) | 2022.11.08 |
[PYTHON] 'Keyword argument not understood:', 'keepdims' (0) | 2022.10.24 |
[PYTHON] ImportError: DLL load failed while importing ie_api: (0) | 2022.08.19 |