geomagpy / magpy

MagPy (or GeomagPy) is a Python package for analysing and displaying geomagnetic data.
BSD 3-Clause "New" or "Revised" License
45 stars 27 forks source link

PyPubSub (wx.lib... ) issue in MagPy 1.0.0 installation with wxPython 4.1 , use older version #100

Closed teraita closed 2 years ago

teraita commented 3 years ago

The installation after updating to conda (4.9.2) in OX 10.12.3. Python 3.8.5 The MagPy1.0 starts, but there was issue with wx.lib.

$xmagpyw /Users/XXX/miniconda3/envs/magpy1/lib/python3.8/site-packages/wx/lib/pubsub/init.py:23: wxPyDeprecationWarning: wx.lib.pubsub has been deprecated, plese migrate your code to use pypubsub, available on PyPI. warnings.warn('wx.lib.pubsub has been deprecated, plese migrate your ' WX Version 4.x Trying to access initialization file: /Users/XXXX/.magpyguiini MagPy version has changed (1.0.0): inititalization parameters will be updated Initialization: Added data Trying to access initialization file: /Users/XXXX/.magpyguiini ... success

There seem to be version handling for wx in the package ( gui/magpy_gui.py ), but something fails. The PyPubSub installed (pip install PyPubSub), it was not installed by geomagpy package.

After that restart and reading of 1min file. File "/Users/XXXX/miniconda3/envs/magpy1/lib/python3.8/site-packages/magpy/gui/magpy_gui.py", line 2277, in OnOpenFile loadDlg = WaitDialog(None, "Loading...", "Loading data.\nPlease wait....") File "/Users/XXXX/miniconda3/envs/magpy1/lib/python3.8/site-packages/magpy/gui/dialogclasses.py", line 7235, in init box2.Add(graphic, 0, wx.EXPAND | wx.ALIGN_CENTER | wx.ALL, 10) wx._core.wxAssertionError: C++ assertion "!(flags & (wxALIGN_BOTTOM | wxALIGN_CENTRE_VERTICAL))" failed at /Users/robind/projects/bb2/dist-osx-py38/build/ext/wxWidgets/src/common/sizer.cpp(2184) in DoInsert(): Vertical alignment flags are ignored with wxEXPAND

The GUI does not open in full size, should it? magpy100_gui_OSX_SIerra

Is this OS X version related problem? There was no mention of the OS X version compatibility backwards. It would be good to know what OS X versions are supported.

teraita commented 3 years ago

Found this related to wxPython 4.1.0: https://github.com/wxWidgets/Phoenix/issues/1738

teraita commented 3 years ago

wxPython need to be downgraded. I tried 4.0.7 and it works! Correct to the installation guide: "pip install wxPython==4.0.7"

leonro commented 2 years ago

Pysubpub was wrongly imported in versions before 1.0.3 wherefore this error notification remained in all versions/platforms. The import issue has now been solved and successfully tested in windows and linux (2b845aefa69fb16191b2fd224f372652faf81167). Serveral additional corrections on box sizers were preformed to support newest wxpython versions. However, MacOS runtime tests have still to be done.

leonro commented 2 years ago

Closing as this should be solved now (see comment from Jan)