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

Python 3.11 is not supported #120

Closed
alexbkv opened this issue Jul 6, 2023 · 5 comments
Closed

Python 3.11 is not supported #120

alexbkv opened this issue Jul 6, 2023 · 5 comments

Comments

@alexbkv
Copy link

alexbkv commented Jul 6, 2023

Hello, everyone!
I am trying to launch openmc-plotter and get the following error:

TypeError: 'PySide2.QtCore.Qt.Alignment' object cannot be interpreted as an integer
/home/alx8kv/venvs/env/lib/python3.11/site-packages/openmc_plotter/__main__.py:52: RuntimeWarning: libshiboken: Overflow: Value <PySide2.QtCore.Qt.Alignment object at 0x7fe048710ef0> exceeds limits of type  [signed] "i" (4bytes).
  splash.showMessage("Loading Model...",
Traceback (most recent call last):
  File "/home/alx8kv/venvs/env/bin/openmc-plotter", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/alx8kv/venvs/env/lib/python3.11/site-packages/openmc_plotter/__main__.py", line 32, in main
    run_app(args)
  File "/home/alx8kv/venvs/env/lib/python3.11/site-packages/openmc_plotter/__main__.py", line 52, in run_app
    splash.showMessage("Loading Model...",
OverflowError

I use Debian in WSL2, if that has anything to do with that. Everything was installed with pip, rather than conda.
If I am missing something, could you. please, point me in the right direction?

@paulromano
Copy link
Contributor

Getting Linux GUI apps running correctly through WSL may be a bit challenging. Have you followed the directions in the link below for GUI app support?
https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps

@alexbkv
Copy link
Author

alexbkv commented Jul 24, 2023

Yes, I have read that, and other GUI apps do work inside WSL.
In the end, I was able to run openmc-plotter inside the develop-dagmc docker container, although I had to additionally install qtbase5-dev inside the image.

@nplinden
Copy link

nplinden commented Sep 23, 2023

I got the same error on a native Ubuntu 23.4 and another Ubuntu 20.4 machine. It seems like the reason is that PySide2 5.15.2.1 is not available for python3.11 and above, and pip installs PySide2 5.13.2 instead.

For some reason bitwise operations on Qt.Alignment flag objects seem broken on this version:

import PySide2
print(PySide2.__version__)
a = (PySide2.QtCore.Qt.AlignHCenter | PySide2.QtCore.Qt.AlignBottom)

returns:

5.13.2
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
TypeError: 'PySide2.QtCore.Qt.AlignmentFlag' object cannot be interpreted as an integer

Thats the error you are getting, as these operations are used to create the splash screen when launching openmc-plotter.

I don't know enough about PySide2 or Qt to propose an elegant fix to the problem, but I guess reverting to python3.10 fixes to issue (it did for me)

@paulromano paulromano changed the title OverflowError when trying to open openmc-plotter Python 3.11 is not supported Sep 26, 2023
@paulromano
Copy link
Contributor

I just updated the title here to reflect the fact that we rely on PySide2, which doesn't currently support Python 3.11 (or at least the wheels that are available on PyPI do not). See here for more details. Python 3.11 is supported as of 5.15.11 but PyPI only has 5.15.2 and earlier. I'm wondering if just switching to PySide6 (see #121) would give us an easier path to a working install on Python 3.11.

@paulromano
Copy link
Contributor

Closed with #127

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

No branches or pull requests

3 participants