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.
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).
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 am not managing to make this work. I am using Widnsos, and my ParaView Python and Anaconda Python are 3.9.5 and 3.9.12, respectively. I have set the environment variable PV_VENV to the anaconda main directory (C:\Users\rudolf.hellmuth\Anaconda3), and run: >> from paraview.web import venv
ParaView is using venv: C:\Users\rudolf.hellmuth\Anaconda3
I guess I’m not sure what could be going on for the scipy part. By default, packages from paraview will be loaded first since you run from pvpython and not python.
Then maybe with scipy you have compiled dependencies to core python which might make it incompatible with pvpython which could prevent its loading.
For compiled python dependency, you really need to be based on the exact same python. Which means, you should probably build ParaView against your anaconda python so you could embed your ParaView into your anaconda.
I haven’t built my paraview. I downloaded the binary installer. I had thought paraview.web.venv would link my pvpython to any python module installed in the venv, as long as the python version is the same for the first and second number (i.e., a module of python x.y.a would work with pvpython x.y.b).
Your understanding is correct with a caveat/limitation.
The limitation is that some python module are actually controlling native code that are linked with the core of Python. In such case, they became incompatible between the Python from ParaView regardless of the version because such python is built with different flags.
But for all the plain python ones and native that don’t link against Python they should work without issue.
most likely and you will have to build PV against that specific python. But that could be done without the superbuild which could be easier. Then just properly set your PYTHONPATH and PATH so the PV libs gets found from your Python (system/anaconda).