Adding ParaView as a dependency to a Python project

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.

Any help would be greatly appreciated!

-Guillaume

You can use PV with a virtual-environment

1 Like

Thanks for your message! Could you elaborate a bit:

  • What do you mean exactly?
  • How do I do that? Do you have a reference?

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.

@jourdain?

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.