ejeschke / ginga

The Ginga astronomical FITS file viewer
BSD 3-Clause "New" or "Revised" License
120 stars 77 forks source link

Cannot run on MacOS arm #1101

Closed jhennawi closed 2 months ago

jhennawi commented 2 months ago

I cloned the most recent version and tried to run and ginga immediately crashes. I get the following error:

(pypeit) Josephs-MBP:ginga joe$ ginga Error reading saved layout: malformed node or string on line 4: <ast.Name object at 0x34e95ba90> Terminating app due to uncaught exception 'NSRangeException', reason: ' -[NSArrayM objectAtIndexedSubscript:]: index 0 beyond bounds for empty array' *** First throw call stack: ( 0 CoreFoundation 0x0000000184c36ccc exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000018471e788 objc_exception_throw + 60 2 CoreFoundation 0x0000000184bad270 -[__NSCFString hasSuffix:] + 0 3 libqcocoa.dylib 0x0000000317876044 _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 274796 4 libqcocoa.dylib 0x00000003178760c8 _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 274928 5 libqcocoa.dylib 0x0000000317874688 _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 268208 6 QtWidgets 0x00000003167411a8 ZN9QListView16selectionChangedERK14QItemSelectionS2 + 204 7 QtCore 0x00000003120cb48c _ZN11QMetaObject8activateEP7QObjectPKS_iPPv + 3808 8 QtCore 0x0000000312291e44 ZN19QItemSelectionModel20emitSelectionChangedERK14QItemSelectionS2 + 216 9 QtCore 0x0000000312291a2c _ZN19QItemSelectionModel6selectERK14QItemSelection6QFlagsINS_13SelectionFlagEE + 636 10 QtCore 0x000000031229170c _ZN19QItemSelectionModel6selectERK11QModelIndex6QFlagsINS_13SelectionFlagEE + 68 11 QtCore 0x00000003122928cc _ZN19QItemSelectionModel15setCurrentIndexERK11QModelIndex6QFlagsINS_13SelectionFlagEE + 260 12 QtWidgets 0x000000031659f338 _ZNK9QComboBox5countEv + 828 13 QtWidgets 0x00000003165a28b4 _ZN9QComboBoxC1ER16QComboBoxPrivateP7QWidget + 2412 14 QtCore 0x00000003120cb224 _ZN11QMetaObject8activateEP7QObjectPKS_iPPv + 3192 15 QtCore 0x000000031227a944 _ZN18QAbstractItemModel13endInsertRowsEv + 200 16 QtGui 0x0000000315a877a4 _ZN18QStandardItemModel11itemChangedEP13QStandardItem + 2376 17 QtWidgets 0x00000003165a5910 _ZN9QComboBox10insertItemEiRK5QIconRK7QStringRK8QVariant + 368 18 QtWidgets.abi3.so 0x00000003152527a0 _ZL22meth_QComboBox_addItemP7_objectS0S0 + 256 19 python3.11 0x00000001027c9fb0 cfunction_call + 60 20 python3.11 0x00000001028ad034 _PyEval_EvalFrameDefault + 197300 21 python3.11 0x000000010276783c _PyFunction_Vectorcall + 476 22 python3.11 0x000000010276d4a0 method_vectorcall + 164 23 python3.11 0x00000001028b1dec _PyEval_EvalFrameDefault + 217196 24 python3.11 0x000000010276783c _PyFunction_Vectorcall + 476 25 python3.11 0x000000010276d4a0 method_vectorcall + 164 26 python3.11 0x00000001028b1dec _PyEval_EvalFrameDefault + 217196 27 python3.11 0x000000010287a30c _PyEval_Vector + 464 28 python3.11 0x000000010287a0ac PyEval_EvalCode + 248 29 python3.11 0x0000000102914598 run_mod + 184 30 python3.11 0x0000000102914364 pyrun_file + 148 31 python3.11 0x0000000102913d90 _PyRun_SimpleFileObject + 268 32 python3.11 0x0000000102913708 _PyRun_AnyFileObject + 216 33 python3.11 0x00000001029372d0 pymain_run_file_obj + 260 34 python3.11 0x0000000102936bf8 pymain_run_file + 72 35 python3.11 0x00000001029363f8 Py_RunMain + 1328 36 python3.11 0x00000001026ff6bc main + 56 37 dyld 0x000000018475a0e0 start + 2360 ) libc++abi: terminating due to uncaught exception of type NSException Abort trap: 6

ejeschke commented 2 months ago

@jhennawi , I'm successfully running on Apple M2 (arm), Mac OS X 14.4.1 (Sonoma) with:

(ginga-dev) erics-mbp:ginga-pure eric$ conda list pyqt
# packages in environment at /Users/eric/miniconda3/envs/ginga-dev:
#
# Name                    Version                   Build  Channel
pyqt                      5.15.2           py39he8f2410_0  

Could you let me know which version of Qt you are running? It looks like the error is crashing in a Qt ComboBox.

jhennawi commented 2 months ago

I believe pyqt6. Can you remind me how to check.

Joe


Joseph F. Hennawi Professor UCSB and Leiden Observatory Phone: 805-893-3503 Mobile: 805-450-8697 E-mail: joe@ @.***>physics.ucsb.edu http://web.physics.ucsb.edu/~joe/ enigma.physics.ucsb.edu

On Fri, Apr 19, 2024 at 22:31 ejeschke @.***> wrote:

@jhennawi https://github.com/jhennawi , I'm successfully running on Apple M2 (arm), Mac OS X 14.4.1 (Sonoma) with:

(ginga-dev) erics-mbp:ginga-pure eric$ conda list pyqt# packages in environment at /Users/eric/miniconda3/envs/ginga-dev:## Name Version Build Channel pyqt 5.15.2 py39he8f2410_0

Could you let me know which version of Qt you are running? It looks like the error is crashing in a Qt ComboBox.

— Reply to this email directly, view it on GitHub https://github.com/ejeschke/ginga/issues/1101#issuecomment-2067562878, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC6HI44ROFWBQ46JDM2T23Y6H4SVAVCNFSM6AAAAABGQDT56WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXGU3DEOBXHA . You are receiving this because you were mentioned.Message ID: @.***>

ejeschke commented 2 months ago

Try:

$ conda list pyqt
ejeschke commented 2 months ago

I just tried pyqt6 with python 3.12. No issues.

(py312) erics-mbp:ginga-pure eric$ conda list pyqt6
# packages in environment at /Users/eric/miniconda3/envs/py312:
#
# Name                    Version                   Build  Channel
pyqt6                     6.6.1                    pypi_0    pypi
pyqt6-qt6                 6.6.3                    pypi_0    pypi
pyqt6-sip                 13.6.0                   pypi_0    pypi
ejeschke commented 2 months ago

@jhennawi reports via Slack: "Okay looks like I fixed the issue. It was using qt_api and QT_PLUGIN_PATH environment variables"