geektoni / whanau-sybil-proof-DHT

Implementation of Whanau, a Sybil-proof Distributed Hash Table, using Peersim.
7 stars 0 forks source link

Issue with show_keys.py #11

Closed geektoni closed 5 years ago

geektoni commented 5 years ago

@andreazampieri When I try to run it using python3 I get this message:

Traceback (most recent call last):
  File "show_keys.py", line 52, in <module>
    mng.window.showMaximized()
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1952, in __getattr__
    return getattr(self.tk, attr)
AttributeError: '_tkinter.tkapp' object has no attribute 'showMaximized'

Apparently, it seems to be a problem related to the backend used to show the plot. See this answer on Stackoverflow for a solution. https://stackoverflow.com/questions/12439588/how-to-maximize-a-plt-show-window-using-python/22418354#22418354

andreazampieri commented 5 years ago

This should be fixed. Close the issue if so

geektoni commented 5 years ago

:(

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/qt_compat.py", line 176, in <module>
    from PySide import QtCore, QtGui, __version__, __version_info__
ImportError: No module named 'PySide'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "show_keys.py", line 10, in <module>
    plt.switch_backend('QT4Agg')
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/pyplot.py", line 233, in switch_backend
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/backend_qt4agg.py", line 18, in <module>
    from .backend_qt5agg import FigureCanvasQTAggBase as _FigureCanvasQTAggBase
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/backend_qt5agg.py", line 16, in <module>
    from .backend_qt5 import QtCore
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/backend_qt5.py", line 26, in <module>
    import matplotlib.backends.qt_editor.figureoptions as figureoptions
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/qt_editor/figureoptions.py", line 20, in <module>
    import matplotlib.backends.qt_editor.formlayout as formlayout
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/qt_editor/formlayout.py", line 56, in <module>
    from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/qt_compat.py", line 179, in <module>
    "Matplotlib qt-based backends require an external PyQt4, PyQt5,\n"
ImportError: Matplotlib qt-based backends require an external PyQt4, PyQt5,
or PySide package to be installed, but it was not found.
geektoni commented 5 years ago

pip3 install pyqt5 will solve the issue, but it is like 117 MB of additional packages that needs to be installed. Couldn't we just remove the window maximize instruction? You could set the dimension of the figure manually, right?

andreazampieri commented 5 years ago

I am encountering a new error, but yeah we could just set a window size and forget about the maximum size

andreazampieri commented 5 years ago

Now it should be fixed since it's backend-agnostic

geektoni commented 5 years ago

Fixed in d075379ca3558313ef81b5c66c1f4f1e42dcb7ec