install other Python modules

Hello, I’m trying to bring this past project (http://www.mathcancer.org/blog/paraview-for-physicell-part-1/) in line with the latest ParaView (5.10.1). I’m starting out on macOS 12 (arm64), but will eventually want it for Windows (and possibly Linux) too. For starters, I see that 5.10.1 comes with an embedded Python (pvpython 3.9.5). Is it possible to (easily) install an additional module, e.g., scipy, that is not already installed?

I saw this post from ~3 yrs ago (by a student in our lab) which asked the same question, for Windows: ParaView - Scipy Module
There didn’t seem to be a very clear answer then, so I wondered if things have changed with 5.10.

thanks!
Randy

Not easily with the binary package. Simple if you build ParaView yourself.

@jourdain

You can use a Python venv to add any additional Python package to ParaView. You just need to import paraview.web.venv and have the path to your venv exported to an environment variable PV_VENV.

Note: Your venv must be built from the same version of Python that is used inside Paraview.

1 Like

I appreciate the replies! I don’t typically work with venv (and more importantly, our users don’t), but does this therefore require that I would need to manually install the Python version that matches that used by PV (and then create a venv using it)? We already essentially require our users to install the very large Anaconda distribution, which will likely not be the same Python version as PV’s. If this additional, somewhat redundant install is necessary, then it may be preferable to opt for a different workflow, like ask them to convert all their .mat formatted files to .vtk (with a script we would provide).

I mean, you could technically enable your anaconda within ParaView assuming your anaconda use Python 3.9.

Sorry, what exactly do you mean by “enabling anaconda within PV”? My current Anaconda distro is at 3.8.8, but maybe there’s been an upgrade.

What I’m saying is that with the same infrastructure I was mentioning before, you can make ParaView access your full Anaconda environment with the caveat that they share the same Python version 3.x.y where X needs to match but not Y. Also because Anaconda will have some native code base, it is possible that some of them won’t work properly within ParaView but you will only know which one, once you try.

So for your use case, you will either need to upgrade your Anaconda to 3.9 or build a ParaView using the Python from Anaconda which will then make it fully compatible.

I hope that clarify what I mean.

1 Like

Thanks very much! It seems to be working for me now, after installing an Anaconda 3.9.x distro and following your advice. I really appreciate your help.