baztian / jaydebeapi

JayDeBeApi module allows you to connect from Python code to databases using Java JDBC. It provides a Python DB-API v2.0 to that database.
GNU Lesser General Public License v3.0
364 stars 147 forks source link

pip error on Module install - HostX86\\x64\\cl.exe' failed with exit code 2 #212

Closed theqaguy1 closed 2 years ago

theqaguy1 commented 2 years ago

hi, when installing the module on Python 3.10.2 64-bit (windows Server 2016 standard 64 bit), I get the following error.

Visual Studio Build tools were installed as follows: image Using Visual Studio Code for install and test but same via command prompt.

Any help appreciated or is this more a pip issue? For example, I've installed pyodbc module without issue.

pip install jaydebeapi
Collecting jaydebeapi
  Using cached JayDeBeApi-1.2.3-py3-none-any.whl (26 kB)
Collecting JPype1
  Using cached JPype1-1.3.0.tar.gz (820 kB)
  Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for JPype1, since package 'wheel' is not installed.
Installing collected packages: JPype1, jaydebeapi
    Running setup.py install for JPype1 ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\SoapUI\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\SoapUI\\AppData\\Local\\Temp\\2\\pip-install-a43jgk71\\jpype1_8cdc90ce315f4375a206432bf3911346\\setup.py'"'"'; __file__='"'"'C:\\Users\\SoapUI\\AppData\\Local\\Temp\\2\\pip-install-a43jgk71\\jpype1_8cdc90ce315f4375a206432bf3911346\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\SoapUI\AppData\Local\Temp\2\pip-record-2c9h298f\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\SoapUI\AppData\Local\Programs\Python\Python310\Include\JPype1'
         cwd: C:\Users\SoapUI\AppData\Local\Temp\2\pip-install-a43jgk71\jpype1_8cdc90ce315f4375a206432bf3911346\
    Complete output (81 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.10
    creating build\lib.win-amd64-3.10\jpype
    copying jpype\beans.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\config.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\dbapi2.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\imports.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\nio.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\pickle.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\protocol.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\types.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_classpath.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_core.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_gui.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jarray.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jclass.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jcollection.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jcustomizer.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jexception.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jinit.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jio.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jmethod.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jobject.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jpackage.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jproxy.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jstring.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jthread.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jvmfinder.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_pykeywords.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\__init__.py -> build\lib.win-amd64-3.10\jpype
    package init file 'jpype\_pyinstaller\__init__.py' not found (or not a regular file)
    creating build\lib.win-amd64-3.10\jpype\_pyinstaller
    copying jpype\_pyinstaller\entry_points.py -> build\lib.win-amd64-3.10\jpype\_pyinstaller
    copying jpype\_pyinstaller\example.py -> build\lib.win-amd64-3.10\jpype\_pyinstaller
    copying jpype\_pyinstaller\hook-jpype.py -> build\lib.win-amd64-3.10\jpype\_pyinstaller
    copying jpype\_pyinstaller\test_jpype_pyinstaller.py -> build\lib.win-amd64-3.10\jpype\_pyinstaller
    copying jpype\_core.pyi -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jcollection.pyi -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jio.pyi -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jstring.pyi -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jthread.pyi -> build\lib.win-amd64-3.10\jpype
    running build_ext
    Call build extensions
    Using Jar cache
    copying native\jars\org.jpype.jar -> build\lib.win-amd64-3.10
    Call build ext
    building '_jpype' extension
    creating build\temp.win-amd64-3.10
    creating build\temp.win-amd64-3.10\Release
    creating build\temp.win-amd64-3.10\Release\native
    creating build\temp.win-amd64-3.10\Release\native\common
    creating build\temp.win-amd64-3.10\Release\native\python
    C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -Inative\common\include -Inative\python\include -Inative\embedded\include -Inative\jni_include -IC:\Users\SoapUI\AppData\Local\Programs\Python\Python310\include -IC:\Users\SoapUI\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.30.30705\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt /EHsc /Tpnative\common\jp_array.cpp /Fobuild\temp.win-amd64-3.10\Release\native\common\jp_array.obj /Zi /EHsc /std:c++14
    jp_array.cpp
    C:\Users\SoapUI\AppData\Local\Temp\2\pip-install-a43jgk71\jpype1_8cdc90ce315f4375a206432bf3911346\native\python\include\jp_pythontypes.h(284): error C2061: syntax error: identifier 'ssize_t'
    C:\Users\SoapUI\AppData\Local\Temp\2\pip-install-a43jgk71\jpype1_8cdc90ce315f4375a206432bf3911346\native\python\include\jp_pythontypes.h(285): error C2805: binary 'operator [' has too few parameters
    C:\Users\SoapUI\AppData\Local\Temp\2\pip-install-a43jgk71\jpype1_8cdc90ce315f4375a206432bf3911346\native\python\include\jp_pythontypes.h(285): error C2333: 'JPPyObjectVector::operator []': error in function declaration; skipping function body
    C:\Users\SoapUI\AppData\Local\Temp\2\pip-install-a43jgk71\jpype1_8cdc90ce315f4375a206432bf3911346\native\common\include\jp_primitivetype.h(44): error C3646: 'getItemSize': unknown override specifier
    C:\Users\SoapUI\AppData\Local\Temp\2\pip-install-a43jgk71\jpype1_8cdc90ce315f4375a206432bf3911346\native\common\include\jp_primitivetype.h(44): error C2059: syntax error: ')'
    C:\Users\SoapUI\AppData\Local\Temp\2\pip-install-a43jgk71\jpype1_8cdc90ce315f4375a206432bf3911346\native\common\include\jp_primitivetype.h(44): error C2238: unexpected token(s) preceding ';'
    native\common\jp_array.cpp(181): error C2065: 'ssize_t': undeclared identifier
    native\common\jp_array.cpp(181): error C2146: syntax error: missing ';' before identifier 'itemsize'
    native\common\jp_array.cpp(181): error C2065: 'itemsize': undeclared identifier
    native\common\jp_array.cpp(182): error C2065: 'ssize_t': undeclared identifier
    native\common\jp_array.cpp(182): error C2146: syntax error: missing ';' before identifier 'sz'
    native\common\jp_array.cpp(182): error C2065: 'sz': undeclared identifier
    native\common\jp_array.cpp(188): error C2065: 'itemsize': undeclared identifier
    native\common\jp_array.cpp(188): error C2039: 'getItemSize': is not a member of 'JPPrimitiveType'
    C:\Users\SoapUI\AppData\Local\Temp\2\pip-install-a43jgk71\jpype1_8cdc90ce315f4375a206432bf3911346\native\common\include\jp_primitivetype.h(20): note: see declaration of 'JPPrimitiveType'
    native\common\jp_array.cpp(189): error C2065: 'sz': undeclared identifier
    native\common\jp_array.cpp(189): error C2065: 'itemsize': undeclared identifier
    native\common\jp_array.cpp(193): error C2065: 'sz': undeclared identifier
    native\common\jp_array.cpp(197): error C2065: 'itemsize': undeclared identifier
    native\common\jp_array.cpp(206): error C2065: 'sz': undeclared identifier
    native\common\jp_array.cpp(216): error C2065: 'itemsize': undeclared identifier
    native\common\jp_array.cpp(224): error C2065: 'itemsize': undeclared identifier
    native\common\jp_array.cpp(227): error C2065: 'sz': undeclared identifier
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\SoapUI\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\SoapUI\\AppData\\Local\\Temp\\2\\pip-install-a43jgk71\\jpype1_8cdc90ce315f4375a206432bf3911346\\setup.py'"'"'; __file__='"'"'C:\\Users\\SoapUI\\AppData\\Local\\Temp\\2\\pip-install-a43jgk71\\jpype1_8cdc90ce315f4375a206432bf3911346\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\SoapUI\AppData\Local\Temp\2\pip-record-2c9h298f\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\SoapUI\AppData\Local\Programs\Python\Python310\Include\JPype1' Check the logs for full command output.
theqaguy1 commented 2 years ago

i moved back to Python 3.9 64 bit as there is a bug in jpype1 module for 3.10 not yet released. https://github.com/jpype-project/jpype/issues/1028