Is it possible to import Python module into Paraview 5.8.0 ?

Is it possible to import Python module (in my case jinja2 for generating HTML report) into Paraview 5.8 ?

Absolutely it is possible. Did you try ?

Hello

We have read it was not possible in 5.7. Just wondering if it would be possible before digging this in . I am not an Python expert so would need to figure out at which level I would install the library and referenced it

Thank you any way for the quick reaction

Regards

Richard

I’ve been using virtual-env inside pvpython since ParaView 5.4.

Just put your package to bin/Lib/site-packages like Python directory, take a reference at files/directory structure generated by paraview installer

Could you please explain us how do you manage to use virtualenv with the default paraview binaries? Thanks!

NVM: I found it https://blog.kitware.com/using-pvpython-and-virtualenv/

With Python 3 you need to do something like that and use virtualenv not venv.

if '--virtual-env' in sys.argv:
  virtualEnvPath = sys.argv[sys.argv.index('--virtual-env') + 1]
  virtualEnv = virtualEnvPath + '/bin/activate_this.py'
  exec(open(virtualEnv).read())
1 Like