openPMD / openPMD/openPMD-api

opmd matplotlib.pylab crash (depending on import order)

Open
#1,792 13 comments 1 reaction 0 assignees View on GitHub
bug frontend: Python3 install machine/system
Dominant language
C++
Stars
161
Forks
59
Avg merge
2d 22h
Merged PRs (30d)
7

Description

**Describe the bug**
Code crashes on import when openpmd is imported before matplotlib

**To Reproduce**
Compile-able/executable code example to reproduce the problem:

```bash
(py-oct25) pgrete@login10 ~ $ python -c "import openpmd_api as opmd; import matplotlib.pylab as plt; print('nope')"
Segmentation fault (core dumped)
(py-oct25) pgrete@login10 ~ $ python -c "import matplotlib.pylab as plt; import openpmd_api as opmd; print('yay')"
yay
(py-oct25) pgrete@login10 ~ $ python -c "import matplotlib as mpl; import openpmd_api as opmd; import matplotlib.pylab as plt; print('yay')"
yay
```

**Expected behavior**
No crash

**Software Environment**
- version of openPMD-api: current dev
- installed openPMD-api via: from source
- machine: Frontier
- name and version of Python implementation: CPython 3.11

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.