# Reload Python Algorithm through Python Shell

**URL:** https://discourse.paraview.org/t/reload-python-algorithm-through-python-shell/14094
**Category:** ParaView Support
**Created:** [March 5, 2024, 11:56pm UTC](https://discourse.paraview.org/t/reload-python-algorithm-through-python-shell/14094 "2024-03-05T23:56:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![HollowSun0](https://discourse.paraview.org/user_avatar/discourse.paraview.org/hollowsun0/32/431_2.png) [@HollowSun0](https://discourse.paraview.org/u/HollowSun0)
#### Post date: [March 5, 2024, 11:56pm UTC](https://discourse.paraview.org/t/reload-python-algorithm-through-python-shell/14094/1 "2024-03-05T23:56:51Z")

</div>

Hi everyone!

I’m currently looking for a way to reload a python algorithm through the python shell

At the moment, I’m able to trigger a reload using the following:

```auto
python_algorithm = FindSource("PythonAlgorithmExample")
python_algorithm.SMProxy.RecreateVTKObjects()

```

but the import fails:

```auto
Warning: In vtkSIPythonSourceProxy.cxx, line 421
vtkSIPythonSourceProxy (000002428C49E620): Failed to re-import module 'SideFlipPlugin'.

```

Does anyone know how to proceed?

---

<div class="post-metadata">

### Author: ![HollowSun0](https://discourse.paraview.org/user_avatar/discourse.paraview.org/hollowsun0/32/431_2.png) [@HollowSun0](https://discourse.paraview.org/u/HollowSun0)
#### Post date: [March 6, 2024, 3:38pm UTC](https://discourse.paraview.org/t/reload-python-algorithm-through-python-shell/14094/2 "2024-03-06T15:38:00Z")

</div>

`python_algorithm.SMProxy.RecreateVTKObjects()` eventually calls `vtkSmartPyObject pvdetail(PyImport_ImportModule("paraview.detail.pythonalgorithm"));`, where the following error is produced:

```auto
Traceback (most recent call last):
  File "C:\Users\TK3D-\AppData\Local\Programs\Python\Python39\Lib\importlib\ __init__.py", line 168, in reload
    raise ModuleNotFoundError(f"spec not found for the module {name!r}", name=name)
ModuleNotFoundError: spec not found for the module 'SideFlipPlugin'

```

but somehow, reloading the Python Module through the UI command button does not have this error 🤔

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 8, 2024, 8:33am UTC](https://discourse.paraview.org/t/reload-python-algorithm-through-python-shell/14094/3 "2024-03-08T08:33:28Z")

</div>

I dont think this is supported. please open an issue: [https://gitlab.kitware.com/paraview/paraview/issues](https://gitlab.kitware.com/paraview/paraview/issues)

---

<div class="post-metadata">

### Author: ![HollowSun0](https://discourse.paraview.org/user_avatar/discourse.paraview.org/hollowsun0/32/431_2.png) [@HollowSun0](https://discourse.paraview.org/u/HollowSun0)
#### Post date: [March 13, 2024, 6:10pm UTC](https://discourse.paraview.org/t/reload-python-algorithm-through-python-shell/14094/4 "2024-03-13T18:10:37Z")

</div>

Thank you for your response, Mathieu!

I’ve created an issue in ParaView here: [https://gitlab.kitware.com/paraview/paraview/-/issues/22530](https://gitlab.kitware.com/paraview/paraview/-/issues/22530)
