Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install under Python 3.10 #1009

Closed
cowwoc opened this issue Oct 11, 2021 · 14 comments · Fixed by #1011
Closed

Cannot install under Python 3.10 #1009

cowwoc opened this issue Oct 11, 2021 · 14 comments · Fixed by #1011

Comments

@cowwoc
Copy link

cowwoc commented Oct 11, 2021

When attempting to pip install JPype1 under Windows 10 I get:

 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -Inative\common\include -Inative\python\include -Inative\embedded\include -IC:\Program Files\Java\jdk-17\include -IC:\Program Files\Java\jdk-17\include\win32 -Ic:\users\gili\documents\daikin-one\python\include -IC:\Python310\include -IC:\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.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\Gili\AppData\Local\Temp\pip-install-0fjlkma0\jpype1_aff26bff63844fe7b53cb4f7c7e8c054\native\python\include\jp_pythontypes.h(284): error C2061: syntax error: identifier 'ssize_t'
  C:\Users\Gili\AppData\Local\Temp\pip-install-0fjlkma0\jpype1_aff26bff63844fe7b53cb4f7c7e8c054\native\python\include\jp_pythontypes.h(285): error C2805: binary 'operator [' has too few parameters
  C:\Users\Gili\AppData\Local\Temp\pip-install-0fjlkma0\jpype1_aff26bff63844fe7b53cb4f7c7e8c054\native\python\include\jp_pythontypes.h(285): error C2333: 'JPPyObjectVector::operator []': error in function declaration; skipping function body
  C:\Users\Gili\AppData\Local\Temp\pip-install-0fjlkma0\jpype1_aff26bff63844fe7b53cb4f7c7e8c054\native\common\include\jp_primitivetype.h(44): error C3646: 'getItemSize': unknown override specifier
  C:\Users\Gili\AppData\Local\Temp\pip-install-0fjlkma0\jpype1_aff26bff63844fe7b53cb4f7c7e8c054\native\common\include\jp_primitivetype.h(44): error C2059: syntax error: ')'
  C:\Users\Gili\AppData\Local\Temp\pip-install-0fjlkma0\jpype1_aff26bff63844fe7b53cb4f7c7e8c054\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\Gili\AppData\Local\Temp\pip-install-0fjlkma0\jpype1_aff26bff63844fe7b53cb4f7c7e8c054\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\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

Python 3.9 used to work just fine.

@john-hen
Copy link

I've also noticed that, see GitHub Actions run on my fork. Builds on Linux and macOS are fine. Only builds on Windows 10 with Python 3.10 produce these strange syntax errors. Same with the py3.10 branch.

@Thrameos
Copy link
Contributor

Seems like a missing include. I see other projects have hit this. Not sure why we would be getting this now. Mostly likely Python changes their includes and something we assumed was included is now missing.

vlm/asn1c#159

@Thrameos
Copy link
Contributor

I converted all the ssize_t to Py_ssize_t which should fix this compiler issue. It will be included in the next release.

@john-hen
Copy link

You missed a spot.

PyObject* operator[](ssize_t i)

But then it builds with Python 3.10 on Windows.

@kamikaze
Copy link

same issue here. any ideas how to solve that?

@Thrameos
Copy link
Contributor

Just waiting on the PR to go through. You can get the fix from the PR.

nguyenv added a commit to TileDB-Inc/TileDB-Py that referenced this issue Nov 29, 2021
* `core.cc` no longer compiles correctly under Windows with Python 3.10
* jpype-project/jpype#1009
nguyenv added a commit to TileDB-Inc/TileDB-Py that referenced this issue Nov 29, 2021
* `core.cc` no longer compiles correctly under Windows with Python 3.10
* jpype-project/jpype#1009
nguyenv added a commit to TileDB-Inc/TileDB-Py that referenced this issue Nov 30, 2021
* `core.cc` no longer compiles correctly under Windows with Python 3.10
* jpype-project/jpype#1009
@mcrysler
Copy link

Still getting this issue in Windows 11, Python 3.10 while trying to install JayDeBeApi. Output attached.
pip-errors.txt

@marscher

This comment was marked as outdated.

@marscher

This comment was marked as outdated.

@marscher
Copy link
Member

Sorry, I should have read the whole thread. We have replaced ssize_t with Py_ssize_t a long time ago. Is Jaydebe using an outdated version of JPype?

@john-hen
Copy link

The latest release, JPype 1.3.0, does not contain the fix discussed here, @marscher.

@marscher
Copy link
Member

Right, but is fixed on master, so we need another release to get Python-3.10 working.

@Thrameos
Copy link
Contributor

Yep. Tis why I have been trying to get the issues closed out. Hopefully this weekend, if work will let up.

@rethat
Copy link

rethat commented May 19, 2022

Still getting this issue in Windows 11, Python 3.10 while trying to install JayDeBeApi. Output attached. pip-errors.txt

I have the same your issue, and I solved it by steps:

  1. go to this link https://www.lfd.uci.edu/~gohlke/pythonlibs/#JPype and download the wheel
    ex: JPype1‑1.3.0‑cp310‑cp310‑win_amd64.whl
  2. using pip to install package just downloaded
    pip install --find-links C:\Temp\ Jpype1
    with C:\Temp is a folder contents your package
  3. install JayDeBeApi
    pip install JayDeBeApi

Hope this help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants