# paraview python plugin loading with virtualenv

**URL:** https://discourse.paraview.org/t/paraview-python-plugin-loading-with-virtualenv/17147
**Category:** ParaView Support
**Created:** [August 30, 2025, 6:50pm UTC](https://discourse.paraview.org/t/paraview-python-plugin-loading-with-virtualenv/17147 "2025-08-30T18:50:12Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![alessandro\_de\_maio](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alessandro_de_maio/32/14800_2.png) [@alessandro\_de\_maio](https://discourse.paraview.org/u/alessandro_de_maio)
#### Post date: [August 30, 2025, 6:50pm UTC](https://discourse.paraview.org/t/paraview-python-plugin-loading-with-virtualenv/17147/1 "2025-08-30T18:50:12Z")

</div>

I have a python plugin that is importing some modules that are not included in the Paraview 6.0.0 distribution, but using the –venv option I can add them to a virtualenv and then the plugin works fine.

If I load the plugin from the Plugin Manager everything is ok.

Now I would like to automatically import that plugin putting its path in the PV\_PLUGIN\_PATH env variable, but the issue is that the plugin loading is done before the virtualenv is considered, so I get an error saying that a module is missing.

Is there a way to post-pone the plugin automatic loading after the virtualenv has been added ?

Thanks in advance for any suggestion

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [August 30, 2025, 11:29pm UTC](https://discourse.paraview.org/t/paraview-python-plugin-loading-with-virtualenv/17147/2 "2025-08-30T23:29:31Z")

</div>

@jourdain Is there any reason to not move `–venv` handling to be before plugin loading?

---

<div class="post-metadata">

### Author: ![jfavre](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5ac83/32.png) [@jfavre](https://discourse.paraview.org/u/jfavre)
#### Post date: [September 1, 2025, 8:36am UTC](https://discourse.paraview.org/t/paraview-python-plugin-loading-with-virtualenv/17147/3 "2025-09-01T08:36:31Z")

</div>

what about loading your plugin after importing paraview.simple in your Python script. By then, all paths should be set correctly. Example:

`import h5py `  
`import numpy as np `  
`from paraview.simple import * `

`LoadPlugin("VTKmFilters", ns=` **`globals`** `())`

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [September 1, 2025, 12:27pm UTC](https://discourse.paraview.org/t/paraview-python-plugin-loading-with-virtualenv/17147/4 "2025-09-01T12:27:52Z")

</div>

It should be fine to set up the `–venv` before plugin loading. The Python environment should be set up by that time anyway. It was just an oversight in my implementation.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [September 1, 2025, 4:13pm UTC](https://discourse.paraview.org/t/paraview-python-plugin-loading-with-virtualenv/17147/5 "2025-09-01T16:13:58Z")

</div>

Issue reported: [https://gitlab.kitware.com/paraview/paraview/-/issues/23087](https://gitlab.kitware.com/paraview/paraview/-/issues/23087). Fix incoming.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [September 1, 2025, 4:28pm UTC](https://discourse.paraview.org/t/paraview-python-plugin-loading-with-virtualenv/17147/6 "2025-09-01T16:28:02Z")

</div>

Fix here: [https://gitlab.kitware.com/paraview/paraview/-/merge\_requests/7460](https://gitlab.kitware.com/paraview/paraview/-/merge_requests/7460)
