Install PyLucene 6,7,8 on Windows 10 64bit

update 2021.10: minor fixes. Tested OK with PyLucene 8.9

update 2019.10: add support for PyLucene 8.1.1

update 2019.03: add support for Pylucene 7.7.1+ and clarify some steps

update 2017.07: add support for Python 3

 

Prerequisites

Install Python 2.7.x or Python 3.4+ or Anaconda (Python 2.7.x or Python 3.4+)

Install python packages: numpy, scipy and gensim

Install JDK 1.8 (64 bit) and set environment variables

*The latest JDK 1.8.x is recommended

*JDK 10+ may be incompatible

*Anaconda is recommended since some people seems to have difficulties with raw Python

*If you use raw Python instead of Anaconda, then you may need to add environment variables such as PYTHONHOME and PYTHONPATH to ensure that python can be called on command-line prompt. For Anaconda user, it is recommended to use Anaconda prompt.

  1. JAVA_HOME=C:\jdk1.8.0_06 (or other path)
  2. add %JAVA_HOME%\bin to PATH
  3. CLASSPATH=.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar
  4. add CLASSPATH as an environment variable
  5. add %JAVA_HOME%\jre\bin\server to PATH
  6. Install one of the following libraries subject to your environment:
  • Visual C++ library for Python 2.7
    • (www.microsoft.com/en-us/download/details.aspx?id=44266)
  • Visual C++ 2015 Build Tools for Python
    • (http://landinghub.visualstudio.com/visual-cpp-build-tools)
  • Visual Studio 2015+  (community version is enough. Choose c++ related tools and all versions of SDK to install in the VS installer)
    • (https://visualstudio.microsoft.com)

Step 1. Install Apache Ant and set environment variables
1. specify ANT_HOME and add ANT_HOME as an environment variable
2. add %ANT_HOME%\bin to PATH
Step 2. Install cygwin 64 and set environment variables
0. When installing cygwin, choose “Devel” from “Default” to “Installed”
*the space of all packages under “Devel” category are quite large (30~70 GB). “Default” with some basic gcc/g++ tools, libraries and make/cmake utilities are already enough for PyLucene installation.
*choose “Debug” from “INSTALL” to “Unstall” or “Default” can save a lot of space.

1. specify CYGWIN_HOME and add CYGWIN_HOME as an environment variable
2. add %CYGWIN_HOME%\bin to PATH
restart your computer

 

Step 3. Download source code of PyLucene and extract, we obtain a directory named ‘PyLucene-6.5’
* For PyLucene 7 user, the latest Pylucene 7.7.1 is recommended because
the previous PyLucene 7.x may encouter errors during the installation
process.

Step 4. Open Anaconda prompt, execute command under directory JCC
1. python setup.py build
2. python setup.py install
restart your computer
for Linux user, edit line 71 of setup.py to specify your JAVA home (For example, ‘linux’: JAVAHOME) or simply set a JCC_JDK environment variable sharing same value with JAVA_HOME.

Step 5. Edit PyLucene-6.5/Makefile

first comment the default configuration (by adding ‘#’) like the following
# Mac OS X 10.12 (64-bit Python 2.7, Java 1.8)
#PREFIX_PYTHON=/Users/vajda/apache/pylucene/_install
#ANT=/Users/vajda/tmp/apache-ant-1.9.3/bin/ant
#PYTHON=$(PREFIX_PYTHON)/bin/python
#JCC=$(PYTHON) -m jcc.__main__ –shared –arch x86_64
#NUM_FILES=8

And then insert the following configuration (the following are just examples)

PREFIX_PYTHON=D:/Progra~2/Anaconda2
ANT=D:/apache-ant-1.9.7/bin/ant
JAVA_HOME=C:/Progra~1/Java/jdk1.8.0_101
PYTHON=$(PREFIX_PYTHON)/python.exe
JCC=$(PYTHON) -m jcc
NUM_FILES=8

*for PyLucene 8 installation, set NUM_FILES=10. If encounter [WinError 267] when executing ‘make install’, execute ‘make clean’ and then ‘make install’ again.

*if the path contains blank space, you need to replace it by dos path like ‘C:/PROGRA~1’

*if you create a Anaconda environment, then change PREFIX_PYTHON to the root directory of this environment. (e.g Anaconda2/envs/ENVIRONMENT_NAME)

 

Step 6. Execute command ‘make’ under directory ‘PyLucene-6.5.0’ to build the whole project

*use command “make -j2” or “make -j4” to speed up

Step 7. Execute command ‘make install’ under directory ‘PyLucene-6.5.0’

 

Frequently Encountered Problems
1. Python (actually ‘setuptools’ package) cannot call Visual C++ (MSVC) to compile the project
solution: Rewrite PYTHON_PATH\Lib\distutils\distutils.cfg like the following
[build]
compiler=msvc

[build_ext]
compiler=msvc

2. It fails when compiling JCC
solution: open setup.py and
find line ‘win32’: [“/EHsc”, “/D_CRT_SECURE_NO_WARNINGS”],
replace this line by

‘win32’: [“/EHsc”, “/D_CRT_SECURE_NO_WARNINGS”,”/bigobj”],

3. [WinError 267] the directory name is invalid

replace NUM_FILES=8 by NUM_FILES=10 in Makefile.

execute ‘make clean’, and then execute ‘make’ to compile the whole project again

4. JCC_JDK not found (may encounter on Linux)

set “JCC_JDK” as environment variable. The value is  same as JAVA_HOME

5. encounter “dynamic mode does not define module export function” when “import lucene” in Python prompt (may encounter on linux)

remove lucene and jcc packages by execute “pip uninstall lucene” and “pip uninstall jcc”

edit pylucene-6.5/jcc/setup.py. replace the line 71 by ‘linux’:JAVAHOME,

remove jcc/build folder and execute “make clean” under pylucene-6.5 directory.

install jcc and pylucene again

53 thoughts on “Install PyLucene 6,7,8 on Windows 10 64bit

  1. Thank you for these instructions!
    I had to change ‘ANT=…/bin/ant’ to ‘ANT=…/bin/ant.bat’ to make it work.

      1. I get and error on cd $(LUCENE); ($(ANT) ivy-availability-check || $(ANT) ivy-bootstrap)

        says command not found
        here is my makefile

        PREFIX_PYTHON=C:\Users\Michal\AppData\Local\Programs\Python\Python37-32
        JAVA_HOME=C:\Program Files\Java\jre1.8.0_191
        ANT=C:\Program~Files\apache-ant\bin\ant.bat
        PYTHON=$(PREFIX_PYTHON)\python.exe
        JCC=$(PYTHON) -m jcc –shared –find-jvm-dll
        NUM_FILES=8

          1. Thanks but I tried that I no such file or directory.
            BTW does ivy come as a default because I had to install it separetely.

          2. i did not install ivy. Maybe you can check your Ant configuration. Someone mentioned that he changed ‘ANT=…/bin/ant’ to ‘ANT=…/bin/ant.bat’ to make it work.

          3. The struggle continues
            Sorry for being so annoying

            LINK : fatal error LNK1181: cannot open input file ‘C:\Python\lib\site-packages\jcc-3.3-py3.7-win32.egg\jcc3\jcc3.lib’
            error: command ‘C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\link.exe’ failed with exit status 1181
            make: *** [Makefile:347: install] Error 1

            i created the cfg file as you suggested, but that didnt help much

    1. double check Ant and JDK/JRE configurations. Delete built files and compile it again.

  2. Dude, installing all packages of ‘Devel’ will take so many times. It will be good if u mentioned exactly which packages to install over all of the packages was there :))

  3. Hello,

    I successfully went through the first sixth step but when I want to make the file I got this error :

    ImportError: cannot import name ‘initVM’ from ‘jcc._jcc3’ (unknown location)
    make: *** [Makefile:285: compile] Error 1

    can anyone help me ?

    1. seems JAVA related environment variables are not set correctly. Try delete _jcc3 folder and start from step 4.

  4. i am getting this error

    (base) C:\pylucene>make -j4
    /usr/bin/sh: -c: line 0: syntax error near unexpected token `struct.pack’
    /usr/bin/sh: -c: line 0: `C:/Users/703261942/AppData/Local/Continuum/anaconda3/python.exe -c \import struct; print(struct.pack(h, 1) == \000\001 and b or l)\\’
    cd lucene-java-8.1.1/lucene; (C:/apache-ant-1.10.7/bin/ant ivy-availability-check || C:/apache-ant-1.10.7/bin/ant ivy-bootstrap)
    cd lucene-java-8.1.1/lucene; C:/apache-ant-1.10.7/bin/ant -Dversion=8.1.1
    make: *** No rule to make target `lucene-java-8.1.1/lucene/expressions/lib/antlr4-runtime-4.5.1-1.jar’, needed by `jars’. Stop.
    make: *** Waiting for unfinished jobs….
    Buildfile: C:\pylucene\lucene-java-8.1.1\lucene\build.xml
    Buildfile: C:\pylucene\lucene-java-8.1.1\lucene\build.xml

    BUILD FAILED
    C:\pylucene\lucene-java-8.1.1\lucene\build.xml:24: The following error occurred while executing this line:
    C:\pylucene\lucene-java-8.1.1\lucene\common-build.xml:63: If you pass -Dversion=… to set a release version, it must match “8.1.1”, optionally followed by a suffix (e.g., “-SNAPSHOT”).

    Total time: 0 seconds
    make: *** [lucene-java-8.1.1/lucene/build/core/lucene-core-8.1.1.jar] Error 1

    BUILD FAILED
    ” does not exist in the project “lucene”.

    Total time: 0 seconds
    Buildfile: C:\pylucene\lucene-java-8.1.1\lucene\build.xml

    BUILD FAILED
    ” does not exist in the project “lucene”.

    Total time: 0 seconds
    make: *** [ivy] Error 1

    1. check your python environment setting or update anaconda. I guess it is a environment issue.

  5. Hi, why do i keep getting “make: *** No rule to make target `lucene-java-8.1.1/lucene/expressions/lib/antlr4-runtime-4.5.1-1.jar’, needed by `jars’. Stop.” as error? Can you please help

    1. an ad-hoc fix is to edit Makefile, comment the lines or items that include antlr4-runtime-4.5.1-1.jar. Sometimes it a internet connection issue, just make again.

      1. Thanks for this blog!! it has been really helpful so far.. But i am stuck here

        No rule to make target ‘lucene-java-7.7.1/lucene/expressions/lib/asm-5.1.jar’, needed by ‘jars’

        i used this to get ivy :
        git clone https://git-wip-us.apache.org/repos/asf/ant-ivy.git
        ant jar
        org.apache.ivy_2.6.0.alpha_20210408175506.jar

        Copied this jar to ant/lib..

        where am i goin wrong? please help me out

        1. I commented these lines to get around the above error:
          #ANTLR_JAR=$(LUCENE)/expressions/lib/antlr4-runtime-4.5.1-1.jar
          #ASM_JAR=$(LUCENE)/expressions/lib/asm-5.1.jar
          #ASM_COMMONS_JAR=$(LUCENE)/expressions/lib/asm-commons-5.1.jar
          #HPPC_JAR=$(LUCENE)/facet/lib/hppc-0.8.1.jar

          But i am stuck here..
          which: no icupkg in (/cygdrive/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/WINDOWS/System32/OpenSSH:/cygdrive/c/Program Files/Git/cmd:/cygdrive/c/Users/INVIMOU/Anaconda3:/cygdrive/c/Program Files/Java/jdk1.8.0_281/bin:/cygdrive/c/Program Files/Java/jdk1.8.0_281/jre/bin:/usr/bin:/cygdrive/c/Program Files/apache-ant-1.9.15/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/WINDOWS/System32/OpenSSH:/cygdrive/c/Program Files/Git/cmd:/cygdrive/c/Users/INVIMOU/AppData/Local/Microsoft/WindowsApps:/cygdrive/c/Users/INVIMOU/AppData/Local/Programs/Microsoft VS Code/bin:/cygdrive/c/Program Files/Git/bin/git.ex:/cygdrive/c/Program Files/Git/cmd”:/cygdrive/c/Python27)
          cd lucene-java-7.7.1/lucene; (C:/Program Files/apache-ant-1.9.15/bin/ant ivy-availability-check || C:/Program Files/apache-ant-1.9.15/bin/ant ivy-bootstrap)
          cd lucene-java-7.7.1/lucene; C:/Program Files/apache-ant-1.9.15/bin/ant -Dversion=7.7.1
          /bin/sh: C:/Program: No such file or directory
          /bin/sh: C:/Program: No such file or directory
          make: *** [Makefile:213: ivy] Error 127
          make: *** Waiting for unfinished jobs….
          /bin/sh: C:/Program: No such file or directory
          make: *** [Makefile:220: lucene-java-7.7.1/lucene/build/core/lucene-core-7.7.1.jar] Error 127

          Could you please help me out?

  6. Hi
    When i enter the make, i’m getting this error.
    Can you help me?

    Traceback (most recent call last):
    File “C:\Python37-32\lib\runpy.py”, line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
    File “C:\Python37-32\lib\runpy.py”, line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
    File “C:\Python37-32\lib\runpy.py”, line 109, in _get_module_details
    __import__(pkg_name)
    File “C:\Python37-32\lib\site-packages\jcc\__init__.py”, line 31, in
    import jcc._jcc3 as _jcc3
    ImportError: DLL load failed: The specified procedure could not be found.
    make: *** [Makefile:348: compile] Error 1

    1. proabably due to incorrect JAVA environment configuration, can command ‘java’ and ‘javac’ be executed in command prompt?

      1. i’ve the same error, I can run java and javac; tried with jdk1.8, jdk11 and jre 1.8

  7. I can’t understand what you mean , tried only with jdk64bit, should I try with 32 bit one?

    1. it seems you use python 32bit, so all libraries and applications need to be 32bit version.

  8. Thanks for you replies
    I’m using python 64 bit, installer name: python-3.8.2-amd64

  9. I read again the previous messages, the error is different from the one to which I’ve replied.

    Traceback (most recent call last):
    File “”, line 1, in
    File “C:\Users\robb\AppData\Local\Programs\Python\Python38\lib\site-packages\jcc\__init__.py”, line 31, in
    import jcc._jcc3 as _jcc3
    ImportError: DLL load failed while importing _jcc3: Impossibile trovare il modulo specificato.

    1. jcc cannot load dll from JAVA environment variables. First uninstall jcc use “pip uninstall jcc”. then config JDK 1.8 64bit properly, and then install jcc again.
      But I suggest a clean-up of all previously installed things and repeat the steps. Anaconda3 64bit is the most recommended python installer.

  10. Hey, when I type the command ‘make’ in the directory it says:

    ‘make’ is not recognized as an internal or external command, operable program or batch file.

    How do I solve it?

  11. PREFIX_PYTHON=C:/Users\user/AppData/Local/Programs/Python/Python37
    ANT=JAVA_HOME=C:/apache-ant-1.9.15/bin/ant.bat
    JAVA_HOME=C:/Program Files/Java/jdk1.8.0_221
    PYTHON=$(PREFIX_PYTHON)/python.exe
    JCC=$(JCC=$(PYTHON) -m jcc.__main__
    NUM_FILES=8

    after excuting make from cygwini had ANT is not defined, please edit makefile as required at top

  12. I got this error again, any fix ?

    Buildfile: build.xml does not exist!
    Build failed

  13. Error i get is:
    ImportError: DLL load failed while importing _jcc3: The specified module could not be found.

    the JCC directory is on both PATH and PYTHONPATH

    Please could you assist

    1. To update, the error stems from the following line of code:

      File: …\Python\Python38\Lib\site-packages\JCC-3.8-py3.8-win-amd64.egg\jcc\__init__.py

      Line 31: import jcc._jcc3 as _jcc3

  14. Hey,

    I went through all steps. During make i got this. What to do next?

    $ make -j4
    which: no icupkg in (/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/cygdrive/d/Program Files (x86)/VMware/VMware Workstation/bin:/cygdrive/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Windows/System32/OpenSSH:/cygdrive/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/cygdrive/c/Windows/system32/config/systemprofile/.dnx/bin:/cygdrive/c/Program Files/Microsoft DNX/Dnvm:/cygdrive/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/120/DTS/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/110/Tools/Binn:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/120/Tools/Binn:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/120/Tools/Binn/ManagementStudio:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/120/DTS/Binn:/cygdrive/c/Program Files/Java/jdk-14.0.2/bin:/cygdrive/c/Users/hp/AppData/Local/Programs/Python/Python38/Scripts:/cygdrive/c/Users/hp/AppData/Local/Programs/Python/Python38:/cygdrive/c/Users/hp/AppData/Local/Microsoft/WindowsApps:/cygdrive/c/Users/hp/AppData/Local/Programs/Microsoft VS Code/bin:/cygdrive/d/New folder/IntelliJ IDEA Community Edition 2020.2.3/bin:/cygdrive/c/Program Files (x86)/WinAnt/bin:/cygdrive/c/Program Files/Java/jdk-14.0.2/bin:/usr/bin:/cygdrive/c/Program Files (x86)/WinAnt/bin:/usr/lib/lapack)
    cd lucene-java-8.6.1/lucene; (JAVA_HOME=”C:/Program Files/Java/jdk-14.0.2″ “C:/Program Files (x86)/WinAnt/bin/ant” ivy-availability-check || JAVA_HOME=”C:/Program Files/Java/jdk-14.0.2″ “C:/Program Files (x86)/WinAnt/bin/ant” ivy-bootstrap)
    “C:/Users/hp/AppData/Local/Programs/Python/Python38″/python.exe -m jcc.__main__ –shared –compiler mingw32 –jar lucene-java-8.6.1/lucene/build/core/lucene-core-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/analysis/common/lucene-analyzers-common-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/backward-codecs/lucene-backward-codecs-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/classification/lucene-classification-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/codecs/lucene-codecs-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/expressions/lucene-expressions-8.6.1.jar –jar build/jar/extensions.jar –jar lucene-java-8.6.1/lucene/build/facet/lucene-facet-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/grouping/lucene-grouping-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/highlighter/lucene-highlighter-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/join/lucene-join-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/analysis/kuromoji/lucene-analyzers-kuromoji-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/memory/lucene-memory-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/misc/lucene-misc-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/analysis/nori/lucene-analyzers-nori-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/queries/lucene-queries-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/queryparser/lucene-queryparser-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/sandbox/lucene-sandbox-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/spatial3d/lucene-spatial3d-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/analysis/stempel/lucene-analyzers-stempel-8.6.1.jar –jar lucene-java-8.6.1/lucene/build/suggest/lucene-suggest-8.6.1.jar –use_full_names –include lucene-java-8.6.1/lucene/expressions/lib/antlr4-runtime-4.5.1-1.jar –include lucene-java-8.6.1/lucene/expressions/lib/asm-7.2.jar –include lucene-java-8.6.1/lucene/expressions/lib/asm-commons-7.2.jar –include lucene-java-8.6.1/lucene/facet/lib/hppc-0.8.1.jar –package java.lang java.lang.System java.lang.Runtime –package java.util java.util.Arrays java.util.Collections java.util.HashMap java.util.HashSet java.util.TreeSet java.lang.IllegalStateException java.lang.IndexOutOfBoundsException java.util.NoSuchElementException java.text.SimpleDateFormat java.text.DecimalFormat java.text.Collator –package java.util.concurrent java.util.concurrent.Executors –package java.util.function –package java.util.regex –package java.io java.io.StringReader –package java.nio.file java.nio.file.Path java.nio.file.Files java.nio.file.Paths –package org.antlr.v4.runtime –package org.antlr.v4.runtime.atn –exclude org.apache.lucene.sandbox.queries.regex.JakartaRegexpCapabilities –exclude org.apache.regexp.RegexpTunnel –exclude org.apache.lucene.store.WindowsDirectory –exclude org.apache.lucene.store.NativePosixUtil –python lucene –mapping org.apache.lucene.document.Document ‘get:(Ljava/lang/String;)Ljava/lang/String;’ –mapping java.util.Properties ‘getProperty:(Ljava/lang/String;)Ljava/lang/String;’ –sequence java.util.AbstractCollection ‘size:()I’ ‘-:-‘ –sequence java.util.AbstractList ‘-:-‘ ‘get:(I)Ljava/lang/Object;’ org.apache.lucene.index.IndexWriter:getReader org.apache.lucene.analysis.Tokenizer:input –version 8.6.1 –module python/collections.py –module python/ICUNormalizer2Filter.py –module python/ICUFoldingFilter.py –module python/ICUTransformFilter.py –files 10 –build
    ICU not installed
    make: *** [Makefile:395: compile] Error 1
    make: *** Waiting for unfinished jobs….
    Buildfile: D:\Downloads\pylucene-8.6.1-src\pylucene-8.6.1\lucene-java-8.6.1\lucene\build.xml

    ivy-availability-check:
    [loadresource] Do not set property disallowed.ivy.jars.list as its length is 0.

    -ivy-fail-disallowed-ivy-version:

    ivy-fail:

    BUILD SUCCESSFUL
    Total time: 0 seconds

    1. sorry for late reply, but i guess there are more than one C compiler installed in your PC, try setting msvc as default by removing icc from the PATH

  15. which: no icupkg in (/cygdrive/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/WINDOWS/System32/OpenSSH:/cygdrive/c/Program Files/Git/cmd:/cygdrive/c/Users/INVIMOU/Anaconda3:/cygdrive/c/Program Files/Java/jdk1.8.0_281/bin:/cygdrive/c/Program Files/Java/jdk1.8.0_281/jre/bin:/usr/bin:/cygdrive/c/Program Files/apache-ant-1.9.15/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/WINDOWS/System32/OpenSSH:/cygdrive/c/Program Files/Git/cmd:/cygdrive/c/Users/INVIMOU/AppData/Local/Microsoft/WindowsApps:/cygdrive/c/Users/INVIMOU/AppData/Local/Programs/Microsoft VS Code/bin:/cygdrive/c/Program Files/Git/bin/git.ex:/cygdrive/c/Program Files/Git/cmd”:/cygdrive/c/Python27)
    cd lucene-java-7.7.1/lucene; (C:/Program Files/apache-ant-1.9.15/bin/ant ivy-availability-check || C:/Program Files/apache-ant-1.9.15/bin/ant ivy-bootstrap)
    cd lucene-java-7.7.1/lucene; C:/Program Files/apache-ant-1.9.15/bin/ant -Dversion=7.7.1
    /bin/sh: C:/Program: No such file or directory
    /bin/sh: C:/Program: No such file or directory
    make: *** [Makefile:213: ivy] Error 127
    make: *** Waiting for unfinished jobs….
    /bin/sh: C:/Program: No such file or directory
    make: *** [Makefile:220: lucene-java-7.7.1/lucene/build/core/lucene-core-7.7.1.jar] Error 127

    Could you please help me out?

  16. running build_ext
    building ‘lucene._lucene’ extension
    Traceback (most recent call last):
    File “C:\Users\INVIMOU\Anaconda3\lib\runpy.py”, line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
    File “C:\Users\INVIMOU\Anaconda3\lib\runpy.py”, line 87, in _run_code
    exec(code, run_globals)
    File “C:\Users\INVIMOU\Anaconda3\lib\site-packages\jcc-3.8-py3.8-win-amd64.egg\jcc\__main__.py”, line 110, in
    cpp.jcc(sys.argv)
    File “C:\Users\INVIMOU\Anaconda3\lib\site-packages\jcc-3.8-py3.8-win-amd64.egg\jcc\cpp.py”, line 615, in jcc
    compile(env, os.path.dirname(args[0]), output, moduleName,
    File “C:\Users\INVIMOU\Anaconda3\lib\site-packages\jcc-3.8-py3.8-win-amd64.egg\jcc\python.py”, line 1891, in compile
    setup(**args)
    File “C:\Users\INVIMOU\Anaconda3\lib\site-packages\setuptools\__init__.py”, line 165, in setup
    return distutils.core.setup(**attrs)
    File “C:\Users\INVIMOU\Anaconda3\lib\distutils\core.py”, line 148, in setup
    dist.run_commands()
    File “C:\Users\INVIMOU\Anaconda3\lib\distutils\dist.py”, line 966, in run_commands
    self.run_command(cmd)
    File “C:\Users\INVIMOU\Anaconda3\lib\distutils\dist.py”, line 985, in run_command
    cmd_obj.run()
    File “C:\Users\INVIMOU\Anaconda3\lib\site-packages\setuptools\command\build_ext.py”, line 87, in run
    _build_ext.run(self)
    File “C:\Users\INVIMOU\Anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py”, line 186, in run
    _build_ext.build_ext.run(self)
    File “C:\Users\INVIMOU\Anaconda3\lib\distutils\command\build_ext.py”, line 340, in run
    self.build_extensions()
    File “C:\Users\INVIMOU\Anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py”, line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
    File “C:\Users\INVIMOU\Anaconda3\lib\distutils\command\build_ext.py”, line 449, in build_extensions
    self._build_extensions_serial()
    File “C:\Users\INVIMOU\Anaconda3\lib\distutils\command\build_ext.py”, line 474, in _build_extensions_serial
    self.build_extension(ext)
    File “C:\Users\INVIMOU\Anaconda3\lib\site-packages\setuptools\command\build_ext.py”, line 208, in build_extension
    _build_ext.build_extension(self, ext)
    File “C:\Users\INVIMOU\Anaconda3\lib\distutils\command\build_ext.py”, line 550, in build_extension
    self.compiler.link_shared_object(
    File “C:\Users\INVIMOU\Anaconda3\lib\distutils\ccompiler.py”, line 713, in link_shared_object
    self.link(CCompiler.SHARED_OBJECT, objects,
    File “C:\Users\INVIMOU\Anaconda3\lib\distutils\_msvccompiler.py”, line 483, in link
    build_temp = os.path.dirname(objects[0])
    IndexError: list index out of range
    make: *** [Makefile:398: install] Error 1

    What is happening here?? Could you please help me out?

    1. The above error is due to MSVC and i have installed the community edition.

      C:\Users\INVIMOU>code –version
      1.55.1
      08a217c4d27a02a5bcde898fd7981bda5b49391b
      x64

      I have added it to path as well..
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build

      I am still getting the same error.
      error: Microsoft Visual C++ 14.0 is required. Get it with “Build Tools for Visual Studio”: https://visualstudio.microsoft.com/downloads/

  17. PYTHON=$(PREFIX_PYTHON)/python.exe
    #JCC=$(PYTHON) -m jcc.__main__ –shared –compiler mingw32
    JCC=$(PYTHON) -m jcc
    JAVA_HOME=C:\Program~Files~(x86)\Java\jdk1.6.0_16
    ANT=C:\apache-ant-1.9.15\bin\ant
    NUM_FILES=8
    but
    Unable to locate tools.jar. Expected to find it in C:\Program Files (x86)\Java\jre1.8.0_281\lib\tools.jar

  18. ICU not installed
    /c/Python26/python.exe -m jcc –jar lucene-java-7.7.1/lucene/build/core/lucene-core-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/analysis/common/lucene-analyzers-common-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/memory/lucene-memory-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/highlighter/lucene-highlighter-7.7.1.jar –jar build/jar/extensions.jar –jar lucene-java-7.7.1/lucene/build/queries/lucene-queries-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/queryparser/lucene-queryparser-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/sandbox/lucene-sandbox-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/analysis/stempel/lucene-analyzers-stempel-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/grouping/lucene-grouping-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/join/lucene-join-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/facet/lucene-facet-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/suggest/lucene-suggest-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/expressions/lucene-expressions-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/analysis/kuromoji/lucene-analyzers-kuromoji-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/misc/lucene-misc-7.7.1.jar –use_full_names –include lucene-java-7.7.1/lucene/expressions/lib/antlr4-runtime-4.5.1-1.jar –include lucene-java-7.7.1/lucene/expressions/lib/asm-5.1.jar –include lucene-java-7.7.1/lucene/expressions/lib/asm-commons-5.1.jar –include lucene-java-7.7.1/lucene/facet/lib/hppc-0.8.1.jar –package java.lang java.lang.System java.lang.Runtime –package java.util java.util.Arrays java.util.Collections java.util.HashMap java.util.HashSet java.util.TreeSet java.lang.IllegalStateException java.lang.IndexOutOfBoundsException java.util.NoSuchElementException java.text.SimpleDateFormat java.text.DecimalFormat java.text.Collator –package java.util.concurrent java.util.concurrent.Executors –package java.util.regex –package java.io java.io.StringReader –package java.nio.file java.nio.file.Path java.nio.file.Files java.nio.file.Paths –exclude org.apache.lucene.sandbox.queries.regex.JakartaRegexpCapabilities –exclude org.apache.regexp.RegexpTunnel –exclude org.apache.lucene.store.WindowsDirectory –exclude org.apache.lucene.store.NativePosixUtil –python lucene –mapping org.apache.lucene.document.Document ‘get:(Ljava/lang/String;)Ljava/lang/String;’ –mapping java.util.Properties ‘getProperty:(Ljava/lang/String;)Ljava/lang/String;’ –sequence java.util.AbstractCollection ‘size:()I’ ‘-:-‘ –sequence java.util.AbstractList ‘-:-‘ ‘get:(I)Ljava/lang/Object;’ org.apache.lucene.index.IndexWriter:getReader org.apache.lucene.analysis.Tokenizer:input –version 7.7.1 –module python/collections.py –module python/ICUNormalizer2Filter.py –module python/ICUFoldingFilter.py –module python/ICUTransformFilter.py –files 8 –build
    /usr/bin/sh: -c: line 0: syntax error near unexpected token `(‘
    /usr/bin/sh: -c: line 0: `/c/Python26/python.exe -m jcc –jar lucene-java-7.7.1/lucene/build/core/lucene-core-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/analysis/common/lucene-analyzers-common-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/memory/lucene-memory-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/highlighter/lucene-highlighter-7.7.1.jar –jar build/jar/extensions.jar –jar lucene-java-7.7.1/lucene/build/queries/lucene-queries-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/queryparser/lucene-queryparser-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/sandbox/lucene-sandbox-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/analysis/stempel/lucene-analyzers-stempel-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/grouping/lucene-grouping-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/join/lucene-join-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/facet/lucene-facet-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/suggest/lucene-suggest-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/expressions/lucene-expressions-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/analysis/kuromoji/lucene-analyzers-kuromoji-7.7.1.jar –jar lucene-java-7.7.1/lucene/build/misc/lucene-misc-7.7.1.jar –use_full_names –include lucene-java-7.7.1/lucene/expressions/lib/antlr4-runtime-4.5.1-1.jar –include lucene-java-7.7.1/lucene/expressions/lib/asm-5.1.jar –include lucene-java-7.7.1/lucene/expressions/lib/asm-commons-5.1.jar –include lucene-java-7.7.1/lucene/facet/lib/hppc-0.8.1.jar –package java.lang java.lang.System java.lang.Runtime –package java.util java.util.Arrays java.util.Collections java.util.HashMap java.util.HashSet java.util.TreeSet java.lang.IllegalStateException java.lang.IndexOutOfBoundsException java.util.NoSuchElementException java.text.SimpleDateFormat java.text.DecimalFormat java.text.Collator –package java.util.concurrent java.util.concurrent.Executors –package java.util.regex –package java.io java.io.StringReader –package java.nio.file java.nio.file.Path java.nio.file.Files java.nio.file.Paths –exclude org.apache.lucene.sandbox.queries.regex.JakartaRegexpCapabilities –exclude org.apache.regexp.RegexpTunnel –exclude org.apache.lucene.store.WindowsDirectory –exclude org.apache.lucene.store.NativePosixUtil –python lucene –mapping org.apache.lucene.document.Document get:(Ljava/lang/String;)Ljava/lang/String; –mapping java.util.Properties getProperty:(Ljava/lang/String;)Ljava/lang/String; –sequence java.util.AbstractCollection size:()I -:- –sequence java.util.AbstractList -:- get:(I)Ljava/lang/Object; org.apache.lucene.index.IndexWriter:getReader org.apache.lucene.analysis.Tokenizer:input –version 7.7.1 –module python/collections.py –module python/ICUNormalizer2Filter.py –module python/ICUFoldingFilter.py –module python/ICUTransformFilter.py –files 8 –build’
    make: *** [Makefile:349: compile] Error 1

    Help

Leave a Reply

Your email address will not be published.

Protected with IP Blacklist CloudIP Blacklist Cloud

This site uses Akismet to reduce spam. Learn how your comment data is processed.