iparaview-kernel: trouble installing within a custom python venv

Hi,
I would like to install iparaview-kernel within a python virtual env.
I have managed to build the kernel without problem
But I can get the example notebook to work.
I guess this is connected to my choice of installation.
cmake .. -DCMAKE_INSTALL_PREFIX=../../pyvista-env

The files are installed in:

-- Install configuration: ""
-- Up-to-date: /mnt/d/python-envs/pyvista-env/IParaView/paraview_kernel.py
-- Up-to-date: /mnt/d/python-envs/pyvista-env/IParaView/kernel.json
-- Up-to-date: /mnt/d/python-envs/pyvista-env/IParaView/config.py
-- Up-to-date: /mnt/d/python-envs/pyvista-env/IParaView/PVQtJupyterPlugin/PVQtJupyterPlugin.so

I guess, the files are not installed correctly…
Where shall I install them?
Thanks for your suggestions
Best
C.

PS: I’m trying this on wsl debian bookworm with pyvista and jupyter in a virtual env.

Cc: @jourdain

This is actually a work from KEU (@mwestphal)

@tgalland

Hi!
I used the kernel once to access paraview from a jupyter notebook. In your case, I think there is nothing wrong in your choice of installation location being a virtual environment. In addition to setting a custom location through cmake variable, you might also need to to setup the ParaView_DIR dependency for init and starting the kernel inside the notebook.

You may also consider posting here any specific error messages you see. That will help Kitware experts to comment on your case.

Hello @Trophime,

Sorry for the late reply.

Indeed it seems that the files are not installed at the good location. The CMAKE_INSTALL_PREFIX should contain a path where the Jupyter Notebook will be able to find the kernel. This path depends on your distribution (please see Making kernels for Jupyter — jupyter_client 8.6.2 documentation). On linux for example, you may want to use ~/.local/share/jupyter/kernels.

Since you are working from a virtual environment, you may need to edit the kernel.json file installed in this directory, and replace the python path (first argument) with the one of your virtual env (e.g. /path_to_your_venv/bin/python3.12). This is an actual limitation of the kernel installation process and we are working on it :slight_smile:

Hoping this will solve your problem.