I’m building an application using the paraview.simple module. To enable CI and generally simplify things, I’d like to include ParaView (PV) as a dependency of my project (I use poetry, my dependencies are in a pyproject.toml file). I see there exists a paraview Anaconda package here, but I couldn’t find an equivalent on PyPI. Hence the question, how can I add PV as a dependency? Is it at all possible?
If not possible, what’s the best option? I can think of:
asking the user to install PV manually in the documentation and create the necessary symlinks in the virtual environment
scripting the download of PV and creation of symlinks
I’m aware I could use pvpython instead of a separate virtual environment, but that doesn’t suit my needs.
He means that you can make a venv and tell ParaView (pvpython) to use that. ParaView is really difficult to make into a wheel at this time, so PyPI distribution isn’t really on the schedule at all.
python3.10 -m venv py-env # make sure you use the same python version as your instance of paraview uses
source py-env/bin/activate
pip install <packages you need>
<paraview>/bin/pvpython script.py --venv ./py-env
Thanks @ben.boeckel & @Christos_Tsolakis for the replies. I’ll test this approach and report back if I run into issues. I also have to think a bit more about how this fits into my goal.
Just to make sure before spending too much time on pvpython using an extra virtual
environment … Am I right in assuming that I can add a virtual environment without building
ParaView from scratch ? I’m actually using Paraview (5.13.0) binaries which come with python 3.10.13. (So I created my own virtual environment pvextra based on python 3.10.13, installing a few python modules: xarray, pyvista and geovista).
Also side note, PyVista will install VTK inside the venv which will conflict with the one available on ParaView. So make sure you remove vtk from the venv.