I have a Python script created on Python 3.5.4. The script is importing nltk. When I am trying to execute the script from java using Jython 2.7.1 it is giving me following errors.
Exception in thread "MainThread" java.lang.ExceptionInInitializerError
Caused by: Traceback (most recent call last):
File "D:\TensorFlow\TflearnExample\ChatBot.py", line 9, in <module>
import nltk
File "D:\Python\Lib\site-packages\nltk\__init__.py", line 137, in <module>
from nltk.stem import *
File "D:\Python\Lib\site-packages\nltk\stem\__init__.py", line 29, in <module>
from nltk.stem.snowball import SnowballStemmer
File "D:\Python\Lib\site-packages\nltk\stem\snowball.py", line 26, in <module>
from nltk.corpus import stopwords
File "D:\Python\Lib\site-packages\nltk\corpus\__init__.py", line 66, in <module>
from nltk.corpus.reader import *
File "D:\Python\Lib\site-packages\nltk\corpus\reader\__init__.py", line 105, in <module>
from nltk.corpus.reader.panlex_lite import *
File "D:\Python\Lib\site-packages\nltk\corpus\reader\panlex_lite.py", line 15, in <module>
import sqlite3
SyntaxError: Non-ASCII character in file 'D:\Python\Lib\sqlite3\__init__.py', but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
Also when I checked the default encoding of Python and Jython then the result was utf-8 and ascii respectively.