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

Running tuneconfig() in IPython console results in Attribute Error (v.2.2.1) #58

Closed
p3rAsperaAdAstra opened this issue May 31, 2023 · 2 comments

Comments

@p3rAsperaAdAstra
Copy link

General Info
OS: Windows 10
Python: 3.8
pdfgetx3: 2.2.1

The error occurse when:
Running tuneconfig() in IPython console

List of commands run:

Ran:
pdfgetx3 myfile.xy --plot=gr,fq,sq

Returns:
Installed qt5 event loop hook.
Shell is already running a gui event loop for qt5. Call with no arguments to disable the current loop.
Using matplotlib backend: QtAgg

Ran:
tuneconfig()

Returns:
This is where the error occurs. It opens up the tuneconfig window, but it remains blank/white.

Traceback:
File diffpy/pdfgetx/pdfgetxapplication.py:279, in tuneconfig(self, plotids, pdfgetter, axeslist)
File diffpy/pdfgetx/tuneconfig.py:518, in createTuneConfig(pdfgetter, **kwargs)
File diffpy/pdfgetx/tuneconfig.py:123, in init(self, pdfgetter, plotids, axeslist, reset_init)
File diffpy/pdfgetx/tuneconfig.py:211, in _makeGUIFigure(self)

AttributeError: 'FigureCanvasQTAgg' object has no attribute 'set_window_title'

So I'm guessing that the issue is the use of the QtAgg backend? I have found an issue while googling that looks like it might hold the explanation for this error:
matplotlib/matplotlib#17716

The solution in that case seems to be to just not include the 'set_window_title' command.

I do not know much about Qt, but it seems like the whole thing crashes simply because the tuneconfig window title is being set to the string "tuneconfig" and the Canvas Class doesn't recognize that method.

Was that method renamed in a different version of Qt? Does tuneconfig really need a title? Do I just need to change the version of one of my python libs?
image

@sbillinge
Copy link
Contributor

sbillinge commented May 31, 2023 via email

@p3rAsperaAdAstra
Copy link
Author

Ok so just for posterity if someone doesn't know about the google group:

This is the link to the relevant issue in the Google Group:
https://groups.google.com/g/diffpy-users/c/166PxpIfLfM/m/wm5U-ZI5GgAJ

If you wish to downgrade you matplotlib version to one that will work, use:
pip install --force-reinstall -v "matplotlib==3.4"

Best option is to create a virtual environment first using virtualenv and then installing the right matplotlib version as noted above.

Everything worked perfectly the moment I downgraded to matplotlib 3.4

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

2 participants