I am trying to install PyLucene on my colab notebook. I am using Java 1.8 for pyLucene 8.8.1 as instructed in the documentation. Here are the steps I followed while installing it followed by the error received.
Machine details -
- Ubuntu: 20.04
- Python: 3.10
- GCC: 11.4.0
- Installed Java 1.8 and set the path accordingly. I have mounted the drive and so will use the paths accordingly.
java_path = "/content/drive/MyDrive/java1.8/jdk1.8.0_202/bin/java"
- Installed Ant and Ivy, and set their paths
ant_path = "/content/drive/MyDrive/ant/apache-ant-1.9.16/bin/ant"
ivy_path = "/content/drive/MyDrive/ivy/apache-ivy-2.5.2/ivy-2.5.2.jar"
- Extracted pyLucene and set its path
pylucene_path = "/content/drive/MyDrive/pylucene/pylucene-8.8.1/"
- Installed JCC. Made one change in the setup.py file. Here is the edited part of the file. The 'linux' key is updated to reflect the pathe of JDK.
JDK = {
'darwin': JAVAHOME or JAVAFRAMEWORKS,
'ipod': '/usr/include/gcc',
'linux': '/content/drive/MyDrive/java1.8/jdk1.8.0_202',
'sunos5': '/usr/jdk/instances/jdk1.6.0',
'win32': JAVAHOME,
'mingw32': JAVAHOME,
'freebsd7': '/usr/local/diablo-jdk1.6.0'
}
- Built and installed the setup.py file.
- Edited the Makefile for PyLucene. Inserted the right paths for JDK and ANT.
# Linux (Debian Jessie 64-bit, Python 3.4.2, Oracle Java 1.8
# Be sure to also set JDK['linux'] in jcc's setup.py to the JAVA_HOME value
# used below for ANT (and rebuild jcc after changing it).
PREFIX_PYTHON=/usr
ANT=JAVA_HOME=/content/drive/MyDrive/java1.8/jdk1.8.0_202 /content/drive/MyDrive/ant/apache-ant-1.9.16/bin/ant
PYTHON=$(PREFIX_PYTHON)/bin/python3
JCC=$(PYTHON) -m jcc --shared
NUM_FILES=200
- Now I run the
make
command, and then themake install
command. Here is the output
Installed /usr/local/lib/python3.10/dist-packages/lucene-8.8.1-py3.10-linux-x86_64.egg
Processing dependencies for lucene==8.8.1
Finished processing dependencies for lucene==8.8.1
- When I run the command
make test
. That is where I get the error. Here is the error
A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007a3cb50d7e3c, pid=57124, tid=0x00007a3cb88c8000
#
# JRE version: Java(TM) SE Runtime Environment (8.0_202-b08) (build 1.8.0_202-b08)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.202-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x6d7e3c] jni_RegisterNatives+0x7c
#
# Core dump written. Default location: /content/drive/MyDrive/pylucene/pylucene-8.8.1/core or core.57124
#
I do not know what I am doing wrong. I have set all the paths right, but do not know where I might be wrong. Any help on this would be massively appreciated. I can share the colab notebook for further clarity.
I tried not mounting the drive and install everything in the current runtime. I change the paths accordingly in the files. However, I get the same error.
There is no reason to do the make test when the make install has been done successfully. Just run this python code to check if pylucene has been installed:
It should run and as output to have: