Installation¶
Note
For troubleshooting information, see these pages: Linux. Mac OS. Windows. Please record a “New Issue” if you have an error that is not listed.
Warning
Python 2 End of Life Announced as January 1st 2020.
This page covers Python 3 only. The last-known version for Python 2 is v0.5.2, install it via pip install konlpy==v0.5.2.
Ubuntu¶
Supported: Xenial(16.04.3 LTS), Bionic(18.04.3 LTS), Disco(19.04), Eoan(19.10)
Install dependencies
# Install Java 1.8 or up $ sudo apt-get install g++ openjdk-8-jdk python3-dev python3-pip curl
Install KoNLPy
$ python3 -m pip install --upgrade pip $ python3 -m pip install konlpy # Python 3.x
Install MeCab (optional)
$ sudo apt-get install curl git $ bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh)
CentOS¶
Supported: CentOS 7, 8
Install dependencies
$ sudo yum install gcc-c++ java-1.8.0-openjdk-devel python3 python3-devel python3-pip make diffutils
Install KoNLPy
$ python3 -m pip install --upgrade pip $ python3 -m pip install konlpy # Python 3.x
Install MeCab (optional)
$ sudo yum install curl git $ bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh)
Mac OS¶
Install KoNLPy
$ python3 -m pip install --upgrade pip $ python3 -m pip install konlpy # Python 3.x
Install MeCab (optional)
$ bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh)
Windows¶
- Does your Python installation’s “bit version” match your Windows OS? If you’re using a 64 bit Windows you need a 64 bit Python, and if you have a 32 bit Windows, you need a 32 bit Python. Reinstall your Python if your bit versions do not match.
How to check your Windows bit version
How to check your Python bit version
Do you have a Java of version 1.7 or above installed, that matches your OS bit version? If not, download and install a JDK. Note again, that the bit versions must match.
Set JAVA_HOME.
Download and install the JPype1 (>=0.5.7) that matches your bit version: win32 for 32 bit and win-amd64 for 64 bit. You may have to upgrade your pip in order to install the downloaded .whl file.
> pip install --upgrade pip > pip install JPype1-0.5.7-cp27-none-win_amd64.whl
From the command prompt, install KoNLPy.
> pip install konlpy
Warning
- KoNLPy’s
Mecab()
class is not supported on Windows machines.
Docker¶
If you are familiar with Docker, it is easy to install konlpy and java-1.7-openjdk on python:3 image.
> FROM python:3 > ENV JAVA_HOME /usr/lib/jvm/java-1.7-openjdk/jre > RUN apt-get update && apt-get install -y g++ default-jdk > RUN pip install konlpy > # Write left part as you want