Qpenmc-plotter import error

After I’ve installed openmc-plotter, and I try to run it, I get this import error (below). I installed the newest pyside2 by pip. Its version is 15.1.1. My linux is ubuntu 20.04. What may be the reason of this error?

Traceback (most recent call last):
  File "/home/yuejin/anaconda3/envs/nuclear/bin/openmc-plotter", line 33, in <module>
  File "/home/yuejin/anaconda3/envs/nuclear/bin/openmc-plotter", line 25, in importlib_load_entry_point
  File "/home/yuejin/anaconda3/envs/nuclear/lib/python3.8/importlib/metadata.py", line 77, in load
  File "/home/yuejin/anaconda3/envs/nuclear/lib/python3.8/importlib/__init__.py", line 127, in import_module
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/yuejin/Cloud/plotter/openmc_plotter/__main__.py", line 8, in <module>
ImportError: /lib/x86_64-linux-gnu/libgssapi_krb5.so.2: undefined symbol: krb5_ser_context_init, version krb5_3_MIT

Hi @kingyue! Thanks for your interest in the plotter.

It looks like there’s an expected version mismatch in the version of the krb5 library, which is what the

undefined symbol: krb5_ser_context_init, version krb5_3_MIT

message is indicating.

I’m wondering if some of the required libraries were installed with conda and others with pip? This could lead to linkages to the wrong set of libraries in the PySide2 install and result in a problem like this. You might try removing pip’s PySide2 installation and give the PySide2 conda package a try instead.

Thanks @pshriwise,

I installed required libraries with pip except those already existing in conda base environment.
This time, I tried uninstalling pyside2 5.15.1 via pip uninstall pyside2 and reinstall pyside2 5.13.2 via conda install -c conda-forge pyside2

Another error is raised:

Traceback (most recent call last): 
  File "/home/yuejin/anaconda3/envs/nuclear/bin/openmc-plotter", line 33, in <module>
    sys.exit(load_entry_point('openmc-plotter', 'console_scripts', 'openmc-plotter')())
  File "/home/yuejin/anaconda3/envs/nuclear/bin/openmc-plotter", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/home/yuejin/anaconda3/envs/nuclear/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/home/yuejin/anaconda3/envs/nuclear/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/yuejin/Cloud/plotter/openmc_plotter/__main__.py", line 11, in <module>
    from .main_window import MainWindow, _openmcReload
  File "/home/yuejin/Cloud/plotter/openmc_plotter/main_window.py", line 15, in <module>
    import openmc.lib
  File "/home/yuejin/Cloud/OpenMC/src/openmc/lib/__init__.py", line 19, in <module>
    import pkg_resources
  File "/home/yuejin/anaconda3/envs/nuclear/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3239, in <module>
    def _initialize_master_working_set():
  File "/home/yuejin/anaconda3/envs/nuclear/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3222, in _call_aside
    f(*args, **kwargs)
  File "/home/yuejin/anaconda3/envs/nuclear/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3251, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/yuejin/anaconda3/envs/nuclear/lib/python3.8/site-packages/pkg_resources/__init__.py", line 567, in _build_master
    ws.require(__requires__)
  File "/home/yuejin/anaconda3/envs/nuclear/lib/python3.8/site-packages/pkg_resources/__init__.py", line 884, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/yuejin/anaconda3/envs/nuclear/lib/python3.8/site-packages/pkg_resources/__init__.py", line 770, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'PySide2' distribution was not found and is required by openmc-plotter

Finally, I resolved this issue by creating a new empty environment and installing all packages with pip. Thanks again!

1 Like

No problem! Glad to hear it’s working!