How can I use konlpy with streamlit sharing?

here is error I’ve got:

I think it’s because of the library “konlpy”, which is Morpheme analyzer for Korean.
To use konlpy, there are pre-works to do:

  1. For Windows:
  • download Java 1.7+
  • set JAVA_HOME path
  • download JPype1 (>=0.5.7)
  • pip install konlpy
  1. For Ubuntu:
  • $ sudo apt-get install g++ openjdk-7-jdk # Install Java 1.7+
  • $ sudo apt-get install python-dev; pip install konlpy # Python 2.x
  • $ sudo apt-get install python3-dev; pip3 install konlpy # Python 3.x
  1. For Mac:
  • $ pip install konlpy # Python 2.x
  • $ pip3 install konlpy # Python 3.x

So here is the question; what should I do to set environment on streamlit-sharing to use konlpy???

Hello @Yoon_Kiseok, welcome to the community!

It seems konlpy does need a Java install to properly run. To install Java on a Streamlit Sharing app, you should add a ´packages.txt’ file at the root with ´default-jre’ inside, and reboot your app to run the install.

See Run librairies relying on Java to work? (e.g. PySpark) - #5 by randyzwitch for an example.

Hope this solves the problem!



Really really really really thanks A LOT!!!

Thanks for your interest!

1 Like

It worked. Thanks a lot!

1 Like