728x90
반응형
한글 맞춤법 검사를 사용하기 위해 사용한 라이브러리 py-hanspell
git 주소 github.com/ssut/py-hanspell
설치 방법은 2가지 방법이 있습니다.
pip install 방법과 git으로 받아서 설치 방법
pip install 중 아래와 같은 오류가 발생하면 git clone으로 설치하면 됩니다.
(Token) C:\Users\user\PycharmProjects\token>pip install py-hanspell
Collecting py-hanspell
Using cached py-hanspell-1.1.tar.gz (3.0 kB)
ERROR: Command errored out with exit status 1:
command: 'C:\Users\user\anaconda3\envs\Token\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-czrkxpsx\\py-hanspell\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-czrkxpsx\\py-hanspell\\setup.py'"'"';f=
getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\user\AppData\Local\Temp\pip-pip-egg-info-wpa18qn3'
cwd: C:\Users\user\AppData\Local\Temp\pip-install-czrkxpsx\py-hanspell\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\user\AppData\Local\Temp\pip-install-czrkxpsx\py-hanspell\setup.py", line 2, in <module>
from pip.req import parse_requirements
ModuleNotFoundError: No module named 'pip.req'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
소스를 변경하라는 스택 오보나 다른 블로그에서 setup 파일에서 에러 부분을 삭제하고 설치하면 된다고는 하지만. 이런 부분이 싫으시다면 git으로 설치하는 걸 추천합니다.
(Token) C:\Users\user\PycharmProjects\token>git clone https://github.com/ssut/py-hanspell.git
Cloning into 'py-hanspell'...
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (17/17), done.
Receiving objects: 82% (83/101)used 9 (delta 3), pack-reused 81
Receiving objects: 100% (101/101), 25.27 KiB | 5.05 MiB/s, done.
Resolving deltas: 100% (42/42), done.
다운받은 위치로 이동후 setup을 하면 정상 설치 됩니다.
(Token) C:\Users\user\PycharmProjects\token\py-hanspell>python setup.py install
running install
running bdist_egg
running egg_info
creating py_hanspell.egg-info
writing py_hanspell.egg-info\PKG-INFO
writing dependency_links to py_hanspell.egg-info\dependency_links.txt
writing requirements to py_hanspell.egg-info\requires.txt
writing top-level names to py_hanspell.egg-info\top_level.txt
writing pbr to py_hanspell.egg-info\pbr.json
writing manifest file 'py_hanspell.egg-info\SOURCES.txt'
reading manifest file 'py_hanspell.egg-info\SOURCES.txt'
writing manifest file 'py_hanspell.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib
creating build\lib\hanspell
copying hanspell\constants.py -> build\lib\hanspell
copying hanspell\response.py -> build\lib\hanspell
copying hanspell\spell_checker.py -> build\lib\hanspell
copying hanspell\__init__.py -> build\lib\hanspell
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\hanspell
copying build\lib\hanspell\constants.py -> build\bdist.win-amd64\egg\hanspell
copying build\lib\hanspell\response.py -> build\bdist.win-amd64\egg\hanspell
copying build\lib\hanspell\spell_checker.py -> build\bdist.win-amd64\egg\hanspell
copying build\lib\hanspell\__init__.py -> build\bdist.win-amd64\egg\hanspell
byte-compiling build\bdist.win-amd64\egg\hanspell\constants.py to constants.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\hanspell\response.py to response.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\hanspell\spell_checker.py to spell_checker.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\hanspell\__init__.py to __init__.cpython-37.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying py_hanspell.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying py_hanspell.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying py_hanspell.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying py_hanspell.egg-info\pbr.json -> build\bdist.win-amd64\egg\EGG-INFO
copying py_hanspell.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying py_hanspell.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist\py_hanspell-1.1-py3.7.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing py_hanspell-1.1-py3.7.egg
Copying py_hanspell-1.1-py3.7.egg to c:\users\user\anaconda3\envs\token\lib\site-packages
Adding py-hanspell 1.1 to easy-install.pth file
Installed c:\users\user\anaconda3\envs\token\lib\site-packages\py_hanspell-1.1-py3.7.egg
Processing dependencies for py-hanspell==1.1
Searching for requests==2.24.0
Best match: requests 2.24.0
Adding requests 2.24.0 to easy-install.pth file
Using c:\users\user\anaconda3\envs\token\lib\site-packages
Searching for certifi==2020.6.20
Best match: certifi 2020.6.20
Adding certifi 2020.6.20 to easy-install.pth file
Using c:\users\user\anaconda3\envs\token\lib\site-packages
Searching for urllib3==1.25.10
Best match: urllib3 1.25.10
Adding urllib3 1.25.10 to easy-install.pth file
Using c:\users\user\anaconda3\envs\token\lib\site-packages
Searching for chardet==3.0.4
Best match: chardet 3.0.4
Adding chardet 3.0.4 to easy-install.pth file
Installing chardetect-script.py script to C:\Users\user\anaconda3\envs\Token\Scripts
Installing chardetect.exe script to C:\Users\user\anaconda3\envs\Token\Scripts
Using c:\users\user\anaconda3\envs\token\lib\site-packages
Searching for idna==2.10
Best match: idna 2.10
Adding idna 2.10 to easy-install.pth file
Using c:\users\user\anaconda3\envs\token\lib\site-packages
Finished processing dependencies for py-hanspell==1.1
그리고 라이브러리를 이용해서 사용하시면 됩니다.
728x90
반응형
'Dev > Python' 카테고리의 다른 글
구글 Bard Api 오류!! SNlM0e value not found. Double-check __Secure-1PSID value or pass it as token='xxxxx'. (3) | 2023.10.13 |
---|---|
[Python]URL 파라메터 추출(feat.urlparse) (0) | 2021.02.04 |
RuntimeError: The current Numpy installation (Feat.pandas-numpy) (0) | 2020.11.27 |
python-웹크롤링(feat. BeautifulSoup)(한글깨짐 처리) (0) | 2020.10.22 |
Python-library [ wordninja ] / 단어분리(영어) (0) | 2020.09.17 |