# Installation Issues - Conflict between qt5 and qt6

**URL:** <https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393>\
**Category:** Support & Discussions\
**Tags:** installation\
**Created:** [October 15, 2024, 1:23pm UTC](https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393 "2024-10-15T13:23:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![r\_ally](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@r\_ally](https://mne.discourse.group/u/r_ally)\
**Post date:** [October 15, 2024, 1:23pm UTC](https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393/1 "2024-10-15T13:23:27Z")

</div>

Hello! I have been having issues with creating plots with mne, for example `stc.plot()`. I have installed mne multiple times (with conda and using the installer). I even removed conda and reinstalled it again but there is an error at the time of installation that persists. The installation procedure works fine but when I try to validate it using sys.info(), I get this error:

- MNE version: 1.8.0
- operating system: e.g. macOS 14

`(improved_mne) % python -c "import mne; mne.sys_info()"`

Platform macOS-14.4-arm64-arm-64bit  
Python 3.12.7 | packaged by conda-forge | (main, Oct 4 2024, 15:57:01) [Clang 17.0.6]  
Executable /opt/anaconda3/envs/improved\_mne/bin/python  
CPU arm (12 cores)  
Memory 18.0 GB

Core  
├☑ mne 1.8.0 (latest release)  
├☑ numpy 1.26.4 (OpenBLAS 0.3.27 with 12 threads)  
├☑ scipy 1.14.1  
Matplotlib is building the font cache; this may take a moment.  
└☑ matplotlib 3.9.2 (backend=macosx)

Numerical (optional)  
├☑ sklearn 1.5.2  
├☑ numba 0.60.0  
├☑ nibabel 5.3.0  
├☑ nilearn 0.10.4  
├☑ dipy 1.9.0  
├☑ openmeeg 2.5.12  
├☑ pandas 2.2.2  
├☑ h5io 0.2.4  
├☑ h5py 3.11.0  
└☐ unavailable cupy

Visualization (optional)  
├☑ pyvista 0.44.1 (OpenGL 4.1 Metal - 88 via Apple M3 Pro)  
├☑ pyvistaqt 0.11.1  
objc[3144]: Class QT\_ROOT\_LEVEL\_POOL\_\_THESE\_OBJECTS\_WILL\_BE\_RELEASED\_WHEN\_QAPP\_GOES\_OUT\_OF\_SCOPE is implemented in both /opt/anaconda3/envs/improved\_mne/lib/libQt5Core.5.15.8.dylib (0x3183b92e0) and /opt/anaconda3/envs/improved\_mne/lib/libQt6Core.6.7.3.dylib (0x320be5558). One of the two will be used. Which one is undefined.  
objc[3144]: Class KeyValueObserver is implemented in both /opt/anaconda3/envs/improved\_mne/lib/libQt5Core.5.15.8.dylib (0x3183b9308) and /opt/anaconda3/envs/improved\_mne/lib/libQt6Core.6.7.3.dylib (0x320be5580). One of the two will be used. Which one is undefined.  
objc[3144]: Class RunLoopModeTracker is implemented in both /opt/anaconda3/envs/improved\_mne/lib/libQt5Core.5.15.8.dylib (0x3183b9358) and /opt/anaconda3/envs/improved\_mne/lib/libQt6Core.6.7.3.dylib (0x320be55d0). One of the two will be used. Which one is undefined.  
├☑ vtk 9.3.1  
zsh: segmentation fault python -c “import mne; mne.sys\_info()”

* * *

After this I get an error window telling me that python has crashed. I am attaching a couple of lines of the error message:

* * *

## Translated Report (Full Report Below)

Process: python3.12 [3332]  
Path: /opt/anaconda3/\*/python  
Identifier: python3.12  
Version: ???  
Code Type: ARM-64 (Native)  
Parent Process: zsh [2590]  
Responsible: pycharm [1532]  
User ID: 501

Date/Time: 2024-10-15 15:17:55.3061 +0200  
OS Version: macOS 14.4 (23E214)  
Report Version: 12  
Anonymous UUID: 1ECFF9FA-B932-B25E-A5B9-B90BE62633EA

Time Awake Since Boot: 3300 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC\_BAD\_ACCESS (SIGSEGV)  
Exception Codes: KERN\_INVALID\_ADDRESS at 0x0000000000000000  
Exception Codes: 0x0000000000000001, 0x0000000000000000

Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11  
Terminating Process: exc handler [3332]

VM Region Info: 0 is not in any region. Bytes before following region: 4345118720  
REGION TYPE START - END [VSIZE] PRT/MAX SHRMOD REGION DETAIL  
UNUSED SPACE AT START  
—\>  
\_\_TEXT 102fd4000-103380000 [3760K] r-x/r-x SM=COW /opt/anaconda3/\*/python3.12

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread  
0 libQt6Gui.6.7.3.dylib 0x301ac4998 +[NSImage(QtExtras) imageFromQIcon:withSize:] + 760  
1 libqcocoa.dylib 0x3084ee2dc 0x3084e4000 + 41692  
2 python3.12 0x10309a688 cfunction\_call + 308  
3 python3.12 0x10303e6d8 \_PyObject\_MakeTpCall + 316  
4 python3.12 0x10316d7c0 \_PyEval\_EvalFrameDefault + 57428  
5 python3.12 0x10315e83c PyEval\_EvalCode + 300  
6 python3.12 0x1031d81a8 run\_mod + 228  
7 python3.12 0x1031dbd0c PyRun\_SimpleStringFlags + 336  
8 python3.12 0x103203a44 Py\_RunMain + 2420  
9 python3.12 0x103204984 pymain\_main + 628  
10 python3.12 0x102fd77c0 main + 56  
11 dyld 0x181ce20e0 start + 2360

Thread 1:  
0 libsystem\_pthread.dylib 0x182065d20 start\_wqthread + 0

Thread 2:  
0 libsystem\_pthread.dylib 0x182065d20 start\_wqthread + 0

Thread 3:  
0 libsystem\_kernel.dylib 0x18202d9ec \_\_psynch\_cvwait + 8  
1 libsystem\_pthread.dylib 0x18206b55c \_pthread\_cond\_wait + 1228  
2 interpreter.cpython-312-darwin.so 0x14a98205c th\_worker(void\*) + 152  
3 libsystem\_pthread.dylib 0x18206af94 \_pthread\_start + 136  
4 libsystem\_pthread.dylib 0x182065d34 thread\_start + 8

Thread 4:  
0 libsystem\_kernel.dylib 0x18202d9ec \_\_psynch\_cvwait + 8  
1 libsystem\_pthread.dylib 0x18206b55c \_pthread\_cond\_wait + 1228  
2 interpreter.cpython-312-darwin.so 0x14a98205c th\_worker(void\*) + 152  
3 libsystem\_pthread.dylib 0x18206af94 \_pthread\_start + 136  
4 libsystem\_pthread.dylib 0x182065d34 thread\_start + 8

Thread 5:  
0 libsystem\_kernel.dylib 0x18202d9ec \_\_psynch\_cvwait + 8  
1 libsystem\_pthread.dylib 0x18206b55c \_pthread\_cond\_wait + 1228  
2 interpreter.cpython-312-darwin.so 0x14a98205c th\_worker(void\*) + 152  
3 libsystem\_pthread.dylib 0x18206af94 \_pthread\_start + 136  
4 libsystem\_pthread.dylib 0x182065d34 thread\_start + 8

* * *

I understand that there may be a conflict between qt5 and qt6, but I am not sure how to resolve this. Should I remove one or the other package?  
Thanks for your help!

---

<div class="post-metadata">

**Author:** ![scott-huberty](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/scott-huberty/32/2715_2.png) [@scott-huberty](https://mne.discourse.group/u/scott-huberty)\
**Post date:** [October 15, 2024, 6:11pm UTC](https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393/2 "2024-10-15T18:11:56Z")

</div>

pinging @larsoner as the Qt guru - Do you have any insight into the problem here? It looks like @r_ally has both `Qt5core` and `Qt6core` installed in their conda environment. Given the warnings in the stack trace, I assume that this is a prime candidate for the failure.

---

<div class="post-metadata">

**Author:** ![larsoner](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/larsoner/32/3_2.png) [@larsoner](https://mne.discourse.group/u/larsoner)\
**Post date:** [October 15, 2024, 6:34pm UTC](https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393/3 "2024-10-15T18:34:19Z")

</div>

Indeed this is a problem with having both frameworks installed ☹ In theory nowadays you should be able to (with `conda-forge` as your selected channel at least) install things like matplotlib, mayavi, etc. with Qt6 support via PySide6, and not need any pyqt. If you try `conda remove pyqt qt-main` it should tell you what it’s going to try to remove alongside PyQt5 and qt5.

---

<div class="post-metadata">

**Author:** ![r\_ally](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@r\_ally](https://mne.discourse.group/u/r_ally)\
**Post date:** [October 15, 2024, 8:00pm UTC](https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393/4 "2024-10-15T20:00:23Z")

</div>

Thank you for your quick replies!  
I ran the command `conda remove pyqt qt-main` and got this message shown:

```python
Channels:
 - defaults
 - conda-forge
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /opt/anaconda3/envs/improved_mne

  removed specs:
    - pyqt
    - qt-main

The following packages will be downloaded:

    package | build
    ---------------------------|-----------------
    mne-1.8.0 |pyside6_h60f6096_100 623 KB conda-forge
    pyside6-6.7.3 | py312h943ac22_1 11.4 MB conda-forge
    ------------------------------------------------------------
                                           Total: 12.0 MB

The following NEW packages will be INSTALLED:

  pyside6 conda-forge/osx-arm64::pyside6-6.7.3-py312h943ac22_1 

The following packages will be REMOVED:

  glib-2.82.1-he7aae3a_1
  glib-tools-2.82.1-he5bafa0_1
  gst-plugins-base-1.24.7-hb49d354_0
  gstreamer-1.24.7-hc3f5269_0
  libclang-cpp15-15.0.7-default_he012953_5
  libintl-devel-0.22.5-h8414b35_3
  libllvm15-15.0.7-h2621b3d_4
  nspr-4.35-hb7217d7_0
  nss-3.105-hd1ce637_0
  ply-3.11-pyhd8ed1ab_2
  pyqt-5.15.9-py312h550cae4_5
  pyqt5-sip-12.12.2-py312h9f69965_5
  qt-main-5.15.8-h1c95b31_26
  sip-6.8.6-py312hde4cb15_1
  toml-0.10.2-pyhd8ed1ab_0

The following packages will be DOWNGRADED:

  mne 1.8.0-pyqt_h8d421b4_200 --> 1.8.0-pyside6_h60f6096_100 

Proceed ([y]/n)?

```

Does it make sense to remove pyqt and qt-main then?  
Thanks again!

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [October 15, 2024, 8:18pm UTC](https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393/5 "2024-10-15T20:18:27Z")

</div>

I would say this looks reasonable, yes!

---

<div class="post-metadata">

**Author:** ![r\_ally](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@r\_ally](https://mne.discourse.group/u/r_ally)\
**Post date:** [October 16, 2024, 11:46am UTC](https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393/6 "2024-10-16T11:46:42Z")

</div>

Thank you all for the help. I did remove PyQt and qt-main as suggested and indeed I got rid of the issue when I printed `sys_info()`. I get the following output printed.

```python
Downloading and Extracting Packages:
                                                                                                                                                                                                
Preparing transaction: done                                                                                                                                                                     
Verifying transaction: done
Executing transaction: done
(improved_mne) % python -c "import mne; mne.sys_info()"
Platform macOS-14.4-arm64-arm-64bit
Python 3.12.7 | packaged by conda-forge | (main, Oct 4 2024, 15:57:01) [Clang 17.0.6]
Executable /opt/anaconda3/envs/improved_mne/bin/python
CPU arm (12 cores)
Memory 18.0 GB

Core
├☑ mne 1.8.0 (latest release)
├☑ numpy 1.26.4 (OpenBLAS 0.3.27 with 12 threads)
├☑ scipy 1.14.1
└☑ matplotlib 3.9.2 (backend=macosx)

Numerical (optional)
├☑ sklearn 1.5.2
├☑ numba 0.60.0
├☑ nibabel 5.3.0
├☑ nilearn 0.10.4
├☑ dipy 1.9.0
├☑ openmeeg 2.5.12
├☑ pandas 2.2.2
├☑ h5io 0.2.4
├☑ h5py 3.11.0
└☐ unavailable cupy

Visualization (optional)
├☑ pyvista 0.44.1 (OpenGL 4.1 Metal - 88 via Apple M3 Pro)
├☑ pyvistaqt 0.11.1
├☑ vtk 9.3.1
├☑ qtpy 2.4.1 (PySide6=6.7.3)
├☑ pyqtgraph 0.13.7
├☑ mne-qt-browser 0.6.3
├☑ ipywidgets 8.1.5
├☑ trame_client 3.3.2
├☑ trame_server 3.2.3
├☑ trame_vtk 2.8.10
├☑ trame_vuetify 2.7.1
└☐ unavailable ipympl

Ecosystem (optional)
├☑ eeglabio 0.0.2-4
├☑ edfio 0.4.4
├☑ mffpy 0.10.0
├☑ pybv 0.7.5
└☐ unavailable mne-bids, mne-nirs, mne-features, mne-connectivity, mne-icalabel, mne-bids-pipeline, neo

```

However when I try to use `stc.plot()` as in the following code (having changed the matplotlib backend from MacOSX to TkAgg):

```python
brain = GA_stc_diff.plot(subjects_dir=mri_dir, subject='fsaverage', surface='white', hemi='both', time_viewer=True, src=fs_src, show_traces=False)
brain.add_annotation('aparc', borders=1, alpha=0.9)

```

I get the following issue before a plot gets printed. However, this plot doesn’t allow me to interact with it and a loading cursor keeps showing until I force quit python.  
`ERROR:root:Invalid Qt API 'pyside6', valid values are: 'pyside', 'pyqt', 'pyqt5', 'pyqt6'`

is there a way about it?  
Many thanks!

---

<div class="post-metadata">

**Author:** ![scott-huberty](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/scott-huberty/32/2715_2.png) [@scott-huberty](https://mne.discourse.group/u/scott-huberty)\
**Post date:** [October 16, 2024, 6:06pm UTC](https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393/7 "2024-10-16T18:06:16Z")

</div>

Hi @r_ally can you share the full stack trace (that resulted in the `ERROR:root:Invalid Qt API ...` )?

---

<div class="post-metadata">

**Author:** ![r\_ally](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@r\_ally](https://mne.discourse.group/u/r_ally)\
**Post date:** [October 17, 2024, 9:26am UTC](https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393/8 "2024-10-17T09:26:30Z")

</div>

Hi @scott-huberty!  
Currently I am debugging using PyCharm. When I let the debugger plot, I do not get this error anymore. I get a plot but I cannot interact with it. I see this output before the plot opens up:

```python
Using pyvistaqt 3d backend.
Using control points [1.25711561 1.27690406 1.34160075]

```

However when I run the plotting commands e.g., this:

```python
brain = GA_stc_diff.plot(subjects_dir=mri_dir, subject='fsaverage', surface='white', hemi='both', time_viewer=True, src=fs_src, show_traces=False)
brain.add_annotation('aparc', borders=1, alpha=0.9)

```

and execute them in the python console, I get the following error:

```python
PyDev console: using IPython 8.28.0
Using control points [1.22882155 1.24525744 1.3952161]
ERROR:root:Invalid Qt API 'pyside6', valid values are: 'pyside', 'pyqt', 'pyqt5', 'pyqt6'

```

---

<div class="post-metadata">

**Author:** ![r\_ally](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@r\_ally](https://mne.discourse.group/u/r_ally)\
**Post date:** [October 21, 2024, 2:29pm UTC](https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393/9 "2024-10-21T14:29:52Z")

</div>

A little update.  
I am able to plot all my figures and interact with them. However, I can only do this when I run IPython in my Terminal using something like this to initialise the IPython console:  
`ipython --gui=qt`

However, when debugging using the PyCharm debugger or executing commands in the Python console, I am still facing the same issue - owing to most likely the way I have configured things. But my main aim was to get the plots, which I have achieved, so that would be a battle for another day.  
Thanks all for the help!

---

<div class="post-metadata">

**Author:** ![scott-huberty](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/scott-huberty/32/2715_2.png) [@scott-huberty](https://mne.discourse.group/u/scott-huberty)\
**Post date:** [October 21, 2024, 4:10pm UTC](https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393/10 "2024-10-21T16:10:10Z")

</div>

Hi @r_ally ,

glad you got it slightly working!

If you would like help trouble shooting further, feel free to stop by the MNE-Python Office hours this Friday: [MNE Office Hours on Discord](https://mne.discourse.group/t/mne-office-hours-on-discord/7439)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [October 28, 2024, 4:10pm UTC](https://mne.discourse.group/t/installation-issues-conflict-between-qt5-and-qt6/10393/11 "2024-10-28T16:10:22Z")

</div>

Closed on October 28, 2024, 4:10pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
