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.

Ubuntu

  1. Install dependencies

    # Install Java 1.7 or up
    $ sudo apt-get install g++ openjdk-7-jdk python-dev python3-dev
    
  2. Install KoNLPy

    $ pip install konlpy        # Python 2.x
    $ pip3 install konlpy       # Python 3.x
    
  3. Install MeCab (optional)

    $ sudo apt-get install curl
    $ bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh)
    

CentOS

  1. Install dependencies

    $ sudo yum install gcc-c++ java-1.7.0-openjdk-devel python-devel
    
    $ wget http://peak.telecommunity.com/dist/ez_setup.py               # Python 2.x
    $ sudo python ez_setup.py
    $ sudo easy_install pip
    
    $ wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tar.xz  # Python 3.x
    $ tar xf Python-3.*
    $ cd Python-3.*
    $ ./configure
    $ make # Build
    $ sudo make altinstall
    
  2. Install KoNLPy

    $ pip install konlpy        # Python 2.x
    $ pip3.4 install konlpy     # Python 3.x
    
  3. Install MeCab (optional)

    $ sudo yum install curl
    $ bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh)
    

Mac OS

  1. Install KoNLPy

    $ pip install konlpy         # Python 2.x
    $ pip3 install konlpy        # Python 3.x
    
  2. Install MeCab (optional)

    $ bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh)
    

Windows

  1. 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

      ../_images/windows-bits.png
    • How to check your Python bit version

      ../_images/python-bits.png
  2. 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.

  3. Set JAVA_HOME.

  4. 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
    
  5. From the command prompt, install KoNLPy.

    > pip install konlpy
    

Warning

  • KoNLPy’s Mecab() class is not supported on Windows machines.