# Segmentation violation error in vapor python

**URL:** <https://vapor.discourse.group/t/segmentation-violation-error-in-vapor-python/342>\
**Category:** Uncategorized\
**Created:** [November 17, 2023, 8:19am UTC](https://vapor.discourse.group/t/segmentation-violation-error-in-vapor-python/342 "2023-11-17T08:19:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wjnadia](https://avatars.discourse-cdn.com/v4/letter/w/f17d59/32.png) [@wjnadia](https://vapor.discourse.group/u/wjnadia)\
**Post date:** [November 17, 2023, 8:19am UTC](https://vapor.discourse.group/t/segmentation-violation-error-in-vapor-python/342/1 "2023-11-17T08:19:32Z")

</div>

I built a docker image for VAPOR Python API(3.9.0) and jupyter vapor widget(1.0.0) in conda environment linked to ipython kernel of Jupyter Lab.  
Jupyter Lab was run in a Docker container. I attempted to run VAPOR examples in Jupyter Lab using the conda vapor python kernel, however the ipython kernel died and was restarted.  
In order to find it’s cause, I ran each line of the example in a Jupyter Lab terminal, and segmentation violation error occurred in the code to import the vapor module such as below.  
Please help me to fix this error.  
Many thanks,  
Joon

(vapor\_python) wjnadia : /scratch/wjnadia/VAPOR/examples$ python  
Python 3.9.12 | packaged by conda-forge | (main, Mar 24 2022, 23:22:55)  
[GCC 10.3.0] on linux  
Type “help”, “copyright”, “credits” or “license” for more information.

‘\>\>\>’ import example\_utils  
‘\>\>\>’ from vapor import session, renderer, dataset, camera, utils  
/opt/conda/envs/vapor\_python/lib/python3.9/site-packages/cppyy\_backend/loader.py:130: UserWarning: No precompiled header available (/opt/conda/envs/vapor\_python/lib/python3.9/site-packages/cppyy\_backend/etc not writable, set CLING\_STANDARD\_PCH); this may impact performance.  
warnings.warn(‘No precompiled header available (%s); this may impact performance.’ % msg)  
Vapor 3.9.0  
Python 3.9.18 (/opt/conda/envs/vapor\_python)  
[GLContextProviderNvidia.cpp:20] Could not load EGL  
[GLContextProviderEGL.cpp:27] Could not load EGL  
[GLContextProvider.cpp:28] Could not get an OpenGL context from the display manager. Is one running?  
[GLContextProvider.cpp:29] Falling back to software rendering  
OpenGL 3.3 (Core Profile) Mesa 21.2.5  
**input\_line\_36:2:19: error: no type named ‘TStreamerInfo’ in namespace ‘CppyyLegacy’**  
\*\* new CppyyLegacy::TStreamerInfo{};\*\*  
\*\* ~~~~~~~~~~~~~ ^\*\*  
\*\* \*\*\* Break \*\*\* segmentation violation\*\*  
Generating stack trace…  
0x00007f3e2f0b6a36 in CppyyLegacy::TClass::TClass(char const\*, short, bool) + 0x236 from /opt/conda/envs/vapor\_python/lib/python3.9/site-packages/cppyy\_backend/lib/libCoreLegacy.so  
0x00007f3e2d347b26 in from /opt/conda/envs/vapor\_python/lib/python3.9/site-packages/cppyy\_backend/lib/libCling.so  
0x00007f3e2f0b0a87 in CppyyLegacy::TClass::GetClass(char const\*, bool, bool) at TClass.cxx:? from /opt/conda/envs/vapor\_python/lib/python3.9/site-packages/cppyy\_backend/lib/libCoreLegacy.so  
0x00007f3e28121c74 in Cppyy::GetScope(std::\_\_cxx11::basic\_string\<char, std::char\_traits, std::allocator \> const&) + 0x104 from /opt/conda/envs/vapor\_python/lib/python3.9/site-packages/cppyy\_backend/lib/libcppyy\_backend.so  
0x00007f3e27d8315a in CPyCppyy::CreateScopeProxy(std::\_\_cxx11::basic\_string\<char, std::char\_traits, std::allocator \> const&, \_object\*, unsigned int) at ProxyWrappers.cxx:? from /opt/conda/envs/vapor\_python/lib/python3.9/site-packages/libcppyy.cpython-39-x86\_64-linux-gnu.so  
0x00007f3e27d49fd5 in from /opt/conda/envs/vapor\_python/lib/python3.9/site-packages/libcppyy.cpython-39-x86\_64-linux-gnu.so

**((a packages for vapor and cppyy list in conda environment for vapor python))**

(vapor\_python) I have no name!@jupyter-vapor-68cc5d9d5-hxp6s:/scratch/wjnadia/VAPOR/examples$ conda list |grep vapor  
jupyter-vapor-widget 1.0.0 py39\_0 ncar-vapor  
vapor 3.9.0 h2bc3f7f\_0 ncar-vapor  
vapor-maps 1.0.0 0 ncar-vapor

(vapor\_python) I have no name!@jupyter-vapor-68cc5d9d5-hxp6s:/scratch/wjnadia/VAPOR/examples$ conda list |grep cppyy  
cppyy 2.2.0 py39ha3ed2ce\_1 conda-forge  
cppyy-backend 1.14.7 py39h1a9c180\_0 conda-forge  
cppyy-cling 6.25.2 py39h0f9e12e\_1 conda-forge  
cpycppyy 1.12.8 py39h1a9c180\_1 conda-forge

**((Dockerfile to build docker image))**

FROM jupyter/base-notebook:latest

USER root

RUN apt update  
RUN apt install git nodejs npm libqt5core5a build-essential -y  
RUN chmod o+rx /home/jovyan

RUN git clone [GitHub - NCAR/jupyter-vapor-widget](https://github.com/NCAR/jupyter-vapor-widget.git)  
RUN cd jupyter-vapor-widget  
RUN pip install -e /home/jovyan/jupyter-vapor-widget  
RUN jupyter labextension install /home/jovyan/jupyter-vapor-widget/js jupyter\_vapor\_widget

RUN conda install -c conda-forge -n base nb\_conda\_kernels conda-libmamba-solver -y  
RUN conda config --set solver libmamba  
RUN mamba create -n vapor\_python python=3.9 ipython ipykernel conda-libmamba-solver -y  
RUN mamba install -c conda-forge -c ncar-vapor -n vapor\_python vapor -y  
RUN /opt/conda/envs/vapor\_python/bin/python -m ipykernel install --user --name=vapor\_python --display-name=VAPOR\_PYTHON  
USER 1000

---

<div class="post-metadata">

**Author:** ![pearse](https://yyz2.discourse-cdn.com/free1/user_avatar/vapor.discourse.group/pearse/32/177_2.png) [@pearse](https://vapor.discourse.group/u/pearse)\
**Post date:** [November 17, 2023, 6:05pm UTC](https://vapor.discourse.group/t/segmentation-violation-error-in-vapor-python/342/2 "2023-11-17T18:05:28Z")

</div>

@StasJ - Thoughts on this?

---

<div class="post-metadata">

**Author:** ![wjnadia](https://avatars.discourse-cdn.com/v4/letter/w/f17d59/32.png) [@wjnadia](https://vapor.discourse.group/u/wjnadia)\
**Post date:** [November 20, 2023, 2:27am UTC](https://vapor.discourse.group/t/segmentation-violation-error-in-vapor-python/342/3 "2023-11-20T02:27:13Z")

</div>

I attach a screenshot of an error that occurred while running VAPOR example in Jupyter Lab.  
For reference, the container image was built based on ubuntu 22.04.

 ![image](https://global.discourse-cdn.com/free1/uploads/vapor/original/1X/799a9036d940f87e137d7f8ee9e76e3190d88f15.png)

---

<div class="post-metadata">

**Author:** ![wjnadia](https://avatars.discourse-cdn.com/v4/letter/w/f17d59/32.png) [@wjnadia](https://vapor.discourse.group/u/wjnadia)\
**Post date:** [November 27, 2023, 1:43am UTC](https://vapor.discourse.group/t/segmentation-violation-error-in-vapor-python/342/4 "2023-11-27T01:43:40Z")

</div>

Any ideas or comments on this issue would be appreciated.  
Thanks,  
Joon

---

<div class="post-metadata">

**Author:** ![StasJ](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@StasJ](https://vapor.discourse.group/u/StasJ)\
**Post date:** [November 27, 2023, 10:25pm UTC](https://vapor.discourse.group/t/segmentation-violation-error-in-vapor-python/342/5 "2023-11-27T22:25:39Z")

</div>

This will create a docker image that can run Vapor in JupyterLab

```auto
FROM continuumio/miniconda3
RUN conda create -y -n vapor -c ncar-vapor -c conda-forge vapor

```
