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

Support Python 3.12 #368

Closed
chezou opened this issue Nov 18, 2023 Discussed in #365 · 5 comments · Fixed by #370
Closed

Support Python 3.12 #368

chezou opened this issue Nov 18, 2023 Discussed in #365 · 5 comments · Fixed by #370

Comments

@chezou
Copy link
Owner

chezou commented Nov 18, 2023

Since jpype hasn't supported Python 3.12 yet, tabula-py installation fails.

jpype-project/jpype#1147

We have two options:

  1. Make jpype1 as optional
  2. Wait jpype supports Python 3.12

As I don't have enough time at this moment, I'm selecting option 2 passively.

Discussed in #365

Originally posted by jflaatsch October 28, 2023
Is tabula-py compatible with Python 3.12? I haven't been able to install it using pip on Windows 11. I followed multiple leads across the web. Please let me know if I'm missing something obvious or if I just need to wait for a minor update.

I have the following installed:

c:>python --version
Python 3.12.0

c:>pip --version
pip 23.3.1 from C:\Users\Jonathan\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip (python 3.12)

c:>java --version
java 21.0.1 2023-10-17 LTS
Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed mode, sharing)

c:>cmake --version
cmake version 3.27.7

CMake suite maintained and supported by Kitware (kitware.com/cmake).

c:>echo %PATH%
C:\Program Files\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Users\Jonathan\AppData\Local\Programs\Python\Python312;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files\Java\jdk-21\bin;C:\Users\Jonathan\AppData\Local\Programs\Python\Python312\Scripts;C:\Users\Jonathan\AppData\Local\Programs\Python\Python312;C:\Users\Jonathan\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Windows Kits\10\bin\x64;

I have Visual Studio Build Tools 2022 - 17.7.6 with "Desktop development with C++" and Visual Studio Community 2022 - 17.6.7 with "Python development", "Node.js development", "Desktop development with C++", and "Linux and embedded development with C++
".

The error while installing tabula-py is the following:

Building wheel for jpype1 (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [127 lines of output]
...
jp_primitivetype.cpp
native\common\jp_primitivetype.cpp(50): error C2039: 'ob_digit': is not a member of '_longobject'
C:\Users\Jonathan\AppData\Local\Programs\Python\Python312\include\cpython/longintrepr.h(87): note: see declaration of '_longobject'
native\common\jp_primitivetype.cpp(50): error C2039: 'ob_digit': is not a member of '_longobject'
C:\Users\Jonathan\AppData\Local\Programs\Python\Python312\include\cpython/longintrepr.h(87): note: see declaration of '_longobject'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for jpype1
Running setup.py clean for jpype1
Failed to build jpype1
ERROR: Could not build wheels for jpype1, which is required to install pyproject.toml-based projects

This may be related to similar issues installing packages with Python 3.12, or something else with compiling in C++:

Any suggestions to work the issue or requests for additional information are welcome.

@Eddy313456
Copy link

question on SO : https://stackoverflow.com/questions/77506267/error-could-not-build-wheels-for-jpype1-which-is-required-to-install-pyproject

@chezou
Copy link
Owner Author

chezou commented Nov 18, 2023

Thank you, @Eddy313456, for giving me supplemental information. I no longer watch SO anymore, but that's fair enough to see the issue.

When I introduced jpype, I investigated how long it takes for jpype to support a new Python version, and it was quick enough. Unfortunately, Python 3.12 has significant internal changes, and I am aware other Python packages also struggle with it.

I'll keep my eyes open on jpype-project/jpype#1147 for a few weeks and will make a decision.

This was referenced Nov 19, 2023
@chezou
Copy link
Owner Author

chezou commented Nov 20, 2023

Released 2.9.0rc0 on PyPI. https://pypi.org/project/tabula-py/2.9.0rc0/
See also #372

Hope it works well on Python 3.12.

@Eddy313456
Copy link

You're most welcome @chezou ..

Looks like 2.9.0rc0 is working good on Python 3.12

@goku updated his answer

https://stackoverflow.com/a/77506329/13086128

@chezou
Copy link
Owner Author

chezou commented Nov 20, 2023

Thanks! I released v2.9.0 on PyPI.

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.

2 participants