# Openmc-plotter Qt dylib error

**URL:** <https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746>\
**Category:** User Support\
**Created:** [September 8, 2020, 7:20pm UTC](https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746 "2020-09-08T19:20:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![RonRahamanANL](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/ronrahamananl/32/1020_2.png) [@RonRahamanANL](https://openmc.discourse.group/u/RonRahamanANL)\
**Post date:** [September 8, 2020, 7:20pm UTC](https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746/1 "2020-09-08T19:20:17Z")

</div>

After I’ve installed openmc-plotter, and I try to run it, I get this runtime error (below). Looks like there’s a conflict between PySide2’s Qt libraries (which was installed as part of the openmc-plotter’s dependencies) and another Qt lib (which was already installed in my conda env).

Note that I installed openmc-plotter with pip (as per the repo’s instructions), whereas I install everything else with conda. I thought that the two were interoperable, but I’m wondering if pip didn’t resolve the dependencies here ?

```auto
objc[79130]: Class QMacAutoReleasePoolTracker is implemented in both /Users/ronald/miniconda3/lib/python3.7/site-packages/PySide2/Qt/lib/QtCore.framework/Versions/5/QtCore (0x1114ed0f8) and /Users/ronald/miniconda3/lib/libQt5Core.5.12.9.dylib (0x1a1d62b538). One of the two will be used. Which one is undefined.
objc[79130]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /Users/ronald/miniconda3/lib/python3.7/site-packages/PySide2/Qt/lib/QtCore.framework/Versions/5/QtCore (0x1114ed170) and /Users/ronald/miniconda3/lib/libQt5Core.5.12.9.dylib (0x1a1d62b5b0). One of the two will be used. Which one is undefined.
objc[79130]: Class KeyValueObserver is implemented in both /Users/ronald/miniconda3/lib/python3.7/site-packages/PySide2/Qt/lib/QtCore.framework/Versions/5/QtCore (0x1114ed198) and /Users/ronald/miniconda3/lib/libQt5Core.5.12.9.dylib (0x1a1d62b5d8). One of the two will be used. Which one is undefined.
objc[79130]: Class RunLoopModeTracker is implemented in both /Users/ronald/miniconda3/lib/python3.7/site-packages/PySide2/Qt/lib/QtCore.framework/Versions/5/QtCore (0x1114ed1e8) and /Users/ronald/miniconda3/lib/libQt5Core.5.12.9.dylib (0x1a1d62b628). One of the two will be used. Which one is undefined.
QObject::moveToThread: Current thread (0x7ffc7af0fca0) is not the object's thread (0x7ffc7ac8b8c0).
Cannot move to target thread (0x7ffc7af0fca0)

You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: cocoa, minimal, offscreen, webgl.

```

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [September 9, 2020, 3:27pm UTC](https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746/2 "2020-09-09T15:27:20Z")

</div>

Yes, I suspect some of the libraries come from different versions and are conflicting. Is it possible to install PySide2 from conda before running `pip install` on the plotter? That should prevent pip from installing it from PyPA.

---

<div class="post-metadata">

**Author:** ![RonRahamanANL](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/ronrahamananl/32/1020_2.png) [@RonRahamanANL](https://openmc.discourse.group/u/RonRahamanANL)\
**Post date:** [September 9, 2020, 4:38pm UTC](https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746/3 "2020-09-09T16:38:24Z")

</div>

Thanks, that helped.

First, I uninstalled the following, which had been installed via pip along with openmc-plotter

- openmc-plotter
- pyside2
- pyqt5-sip
- pyqtchart
- pyqtwebengine
- shiboken2

Then I installed pyside2 via conda. v5.13 is in conda forge

Then I installed openmc-plotter via pip. It installed the following:

- PySide2-5.15.0
- openmc-plotter-0.1.0
- shiboken2-5.15.0

So pip decided to install a newer version of PySide, but it didn’t install any more Qt libraries.

Now openmc-plotter works!

---

<div class="post-metadata">

**Author:** ![Ahmad](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Ahmad](https://openmc.discourse.group/u/Ahmad)\
**Post date:** [January 10, 2022, 9:37pm UTC](https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746/4 "2022-01-10T21:37:57Z")

</div>

> [@RonRahamanANL](#):
>
> shiboken2

Hi All,

I was not able to run the plotter, openmc-plotter even though it looks like all the requested libraries are being installed correctly. Currently, the error I am getting is in “shibiken2” even though the successful installation of openmc-plotter prints the message “Successfully installed PySide2-5.15.2 openmc-plotter-0.1.1 shiboken2-5.15.2” at its end. I followed all the procedures documented in this thread, but I still wasn’t able to make it work.

Here is the error message I get when I try to run the plotter:

PySide2/ **init**.py: Unable to import shiboken2 from /home/xmi/anaconda3/envs/openmc-env/bin, /home/xmi/anaconda3/envs/openmc-env/lib/python39.zip, /home/xmi/anaconda3/envs/openmc-env/lib/python3.9, /home/xmi/anaconda3/envs/openmc-env/lib/python3.9/lib-dynload, /home/xmi/anaconda3/envs/openmc-env/lib/python3.9/site-packages  
Traceback (most recent call last):  
File “/home/xmi/anaconda3/envs/openmc-env/bin/openmc-plotter”, line 5, in   
from openmc\_plotter. **main** import main  
File “/home/xmi/anaconda3/envs/openmc-env/lib/python3.9/site-packages/openmc\_plotter/ **main**.py”, line 8, in   
from PySide2 import QtCore, QtGui  
File “/home/xmi/anaconda3/envs/openmc-env/lib/python3.9/site-packages/PySide2/ **init**.py”, line 107, in   
\_setupQtDirectories()  
File “/home/xmi/anaconda3/envs/openmc-env/lib/python3.9/site-packages/PySide2/ **init**.py”, line 58, in \_setupQtDirectories  
import shiboken2  
File “/home/xmi/anaconda3/envs/openmc-env/lib/python3.9/site-packages/shiboken2/ **init**.py”, line 30, in   
\_init\_pyside\_extension()  
NameError: name ‘\_init\_pyside\_extension’ is not defined

Thank you

Ahmad

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [January 10, 2022, 10:15pm UTC](https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746/5 "2022-01-10T22:15:36Z")

</div>

Just searching online, it sounds like this is some kind of version mismatch with PySide2. See the following:

> <https://github.com/rizinorg/cutter-jupyter/issues/12#issuecomment-703237214>
>
> \*\*Info\*\*
> 
> \* Ubuntu 20.04
> \* Python 3.8.2
> \* Cutter 1.12.0
> \* x86\_64
> 
> 
> \*\*Log…\*\*
> \`\`\`
> qt5ct: using qt5ct plugin
> Plugins are loaded from "/home/pikey/.local/share/RadareOrg/Cutter/plugins"
> Couldn't load module for plugin: "cutter\_jupyter"
> Traceback (most recent call last):
> File "/home/pikey/.local/share/RadareOrg/Cutter/plugins/python/cutter\_jupyter/\_\_init\_\_.py", line 2, in \<module\>
> from . import plugin
> File "/home/pikey/.local/share/RadareOrg/Cutter/plugins/python/cutter\_jupyter/plugin.py", line 3, in \<module\>
> from PySide2.QtWidgets import QAction
> File "/home/pikey/.local/lib/python3.8/site-packages/PySide2/\_\_init\_\_.py", line 107, in \<module\>
> \_setupQtDirectories()
> File "/home/pikey/.local/lib/python3.8/site-packages/PySide2/\_\_init\_\_.py", line 69, in \_setupQtDirectories
> \_init\_pyside\_extension()
> NameError: name '\_init\_pyside\_extension' is not defined
> Loaded 1 plugin(s).
> Plugins are loaded from "/usr/share/mate/RadareOrg/Cutter/plugins"
> Plugins are loaded from "/home/pikey/.local/share/flatpak/exports/share/RadareOrg/Cutter/plugins"
> Plugins are loaded from "/var/lib/flatpak/exports/share/RadareOrg/Cutter/plugins"
> Plugins are loaded from "/usr/local/share/RadareOrg/Cutter/plugins"
> Plugins are loaded from "/usr/share/RadareOrg/Cutter/plugins"
> Plugins are loaded from "/var/lib/snapd/desktop/RadareOrg/Cutter/plugins"
> qt5ct: D-Bus global menu: no
> qt5ct: palette support is disabled
> qt5ct: custom style sheet is disabled
> \`\`\`

[https://forum.freecadweb.org/viewtopic.php?f=4&t=57786&p=496662#p496662](https://forum.freecadweb.org/viewtopic.php?f=4&t=57786&p=496662#p496662)

---

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [January 11, 2022, 7:10am UTC](https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746/6 "2022-01-11T07:10:34Z")

</div>

There are some additional things you should consider before installing plotter because version mismatch happens quite often between pip (comes with pyside2-5.15) and conda (pyside2-5.12)  
And make sure you didn’t install pyside2 (5.12) accidentally by default using conda.

## Remove unused packages and caches.

```bash
conda clean --all
pip cache purge # To remove all the wheel files in the cache.

# Install plotter
pip install --no-cache-dir . # `--no-cache-dir` option is used to avoid using the cache by pip.

```

---

<div class="post-metadata">

**Author:** ![Ahmad](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Ahmad](https://openmc.discourse.group/u/Ahmad)\
**Post date:** [January 11, 2022, 2:50pm UTC](https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746/7 "2022-01-11T14:50:38Z")

</div>

Thank you very much guys. Thanks to your very helpful feedback, I think I am making progress, but I got stuck at another library, “pyqt5”, which I think is required by the backend of matplotlib.

Based on your comments, I did:

$ pip uninstall pyside2  
The result was Successfully uninstalled PySide2-5.15.2

then  
$ pip install pyside2==5.13.0

I chose version 5.13 because I got an error message when I tried another version:  
ERROR: Could not find a version that satisfies the requirement pyside2==5.15.0 (from versions: 0.0.0a1, 5.11.0, 5.11.1, 5.11.2, 5.12.0, 5.12.1, 5.12.2, 5.12.3, 5.12.4, 5.12.5, 5.12.6, 5.13.0, 5.13.1, 5.13.2, 5.15.1, 5.15.2)

Now, when I try to run openmc-plotter, I get an error, ImportError: cannot import name ‘is\_pyqt5’ from ‘matplotlib.backends.qt\_compat’ (/home/xmi/anaconda3/envs/openmc-env/lib/python3.9/site-packages/matplotlib/backends/qt\_compat.py).

Here is the full errors messages I am getting:  
Traceback (most recent call last):  
File “/home/xmi/anaconda3/envs/openmc-env/bin/openmc-plotter”, line 5, in   
from openmc\_plotter. **main** import main  
File “/home/xmi/anaconda3/envs/openmc-env/lib/python3.9/site-packages/openmc\_plotter/ **main**.py”, line 11, in   
from .main\_window import MainWindow, \_openmcReload  
File “/home/xmi/anaconda3/envs/openmc-env/lib/python3.9/site-packages/openmc\_plotter/main\_window.py”, line 24, in   
from .plotgui import PlotImage, ColorDialog  
File “/home/xmi/anaconda3/envs/openmc-env/lib/python3.9/site-packages/openmc\_plotter/plotgui.py”, line 9, in   
from matplotlib.backends.qt\_compat import is\_pyqt5  
ImportError: cannot import name ‘is\_pyqt5’ from ‘matplotlib.backends.qt\_compat’ (/home/xmi/anaconda3/envs/openmc-env/lib/python3.9/site-packages/matplotlib/backends/qt\_compat.py)

Thank you again

Ahmad

---

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [January 11, 2022, 3:21pm UTC](https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746/8 "2022-01-11T15:21:24Z")

</div>

@Ahmad comment out the following line

> <https://github.com/openmc-dev/plotter/blob/bf03181573a1b4d6f2a582ad0ef138ed15a8dbfb/openmc_plotter/plotgui.py#L9>

---

<div class="post-metadata">

**Author:** ![Ahmad](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Ahmad](https://openmc.discourse.group/u/Ahmad)\
**Post date:** [January 11, 2022, 4:26pm UTC](https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746/9 "2022-01-11T16:26:14Z")

</div>

> [@RonRahamanANL](#):
>
> pyside2

That worked 🙂 . Thank you very much Pranto.

---

<div class="post-metadata">

**Author:** ![Ahmad](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Ahmad](https://openmc.discourse.group/u/Ahmad)\
**Post date:** [January 11, 2022, 4:26pm UTC](https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746/10 "2022-01-11T16:26:47Z")

</div>

That worked 🙂 . Thank you very much Pranto.

---

<div class="post-metadata">

**Author:** ![HamzaGhninou](https://avatars.discourse-cdn.com/v4/letter/h/bcef8e/32.png) [@HamzaGhninou](https://openmc.discourse.group/u/HamzaGhninou)\
**Post date:** [September 28, 2023, 9:51pm UTC](https://openmc.discourse.group/t/openmc-plotter-qt-dylib-error/746/11 "2023-09-28T21:51:38Z")

</div>

Thank you for the installation guidelines. I had the same problem, I followed your guidelines and now it’s working 😀
