konsim83/SIR-Models

SIR-Models main.py fails

Closed this issue · 5 comments

Hello,
when starting main.py it fails on line 476 with the following error-message:
File "...\SIR-Models-master\SIR-Models-master\src\main.py", line 476, in callback_solve
self.plot_legend.scene().removeItem(self.plot_legend)
AttributeError: 'NoneType' object has no attribute 'removeItem'

I'm running Python 3.7 on Windows (WinPython64-3.7.7.0 = Python 3.7 64bit + PyQt5 + Spyder)

Greetings
R. D. Stoll

Hi @rolfdstoll,
I wrote it under Linux and there it works fine. However, I also tested it under Windows 10 with Python 3.7 and it works fine. Do you have pyqtgraph installed? this is separate from PyQt5.

Cheers,
Konrad

It also works with anaconda and virtual environments. Note that IDEs can make trouble when the PATH or other environment variables are not set correctly. Note that when installing Python for Windows the standard setting is NOT to add Python to the PATH (also for Anaconda I guess). Therefore, I am closing the issue.

I think it may be the version of pyqtgraph. I am using v0.10. With v0.11 I get the same error. Will try to fix it

Yes, I think the problem is pyqtgraph. On WinPython the installed version is 0.11.0rc0. That's where the error occurs.
When I tried it on Anaconda, it works more or less. The pyqtgraph-version there is 0.10.0. But there is another problem: Regardless of the size of the main window, the button "reset values" is not visible, the button SIR model only half. To see this buttons, I changed the values of the responsible gridLayoutWidgets with .setGeometry(), but I think, this should be solved dynamically by the application, regardless of the respective properties of the sreen.

I fixed the version issue with pyqtgraph. About the other issue you are welcome to suggest a fix and submit a pull request :-) since I can not reproduce the issue.