# TypeError when importing paraview simple

**URL:** https://discourse.paraview.org/t/typeerror-when-importing-paraview-simple/11879
**Category:** Development
**Tags:** python
**Created:** [April 14, 2023, 12:23am UTC](https://discourse.paraview.org/t/typeerror-when-importing-paraview-simple/11879 "2023-04-14T00:23:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Kieran\_M](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kieran_m/32/11375_2.png) [@Kieran\_M](https://discourse.paraview.org/u/Kieran_M)
#### Post date: [April 14, 2023, 12:23am UTC](https://discourse.paraview.org/t/typeerror-when-importing-paraview-simple/11879/1 "2023-04-14T00:23:16Z")

</div>

Hi,

I have recently encountered a `TypeError` when trying to import some modules from `paraview.simple`. I am trying to import these modules form an Anaconda environment with python 3.9.16. It can be reproduced as follows:

```auto
>>> import paraview.simple
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/kieran/anaconda3/envs/shapeopt/lib/python3.9/site-packages/paraview/simple.py", line 41, in <module>
    from paraview import servermanager
  File "/home/kieran/anaconda3/envs/shapeopt/lib/python3.9/site-packages/paraview/servermanager.py", line 3255, in <module>
    if not vtkInitializationHelper.Initialize(slist, ptype):
TypeError: arguments do not match any overloaded methods

```

I installed paraview from [conda-forge](https://anaconda.org/conda-forge/paraview), but have also tried installing from source and appending to the PYTHONPATH.

Running on Ubuntu 20.04.6.

Thanks

**Edit to add** : I have narrowed this down to a conflict somewhere with the `vtk` python package, which gets installed when I install `pyvista` as part of another dependency. I have found the following workaround:

- I install all of my required packages
- `pip uninstall vtk`
- in the python interpreter/script, before importing `paraview.simple`, run `import vtk`, which will overload the vtk namespace with the vtk python package included in the ParaView distribution (in `/lib/python3.9/site-packages/vtk.py`).

After this, I am able to import `paraview.simple` as desired and retain all functionality.

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [April 17, 2023, 7:45am UTC](https://discourse.paraview.org/t/typeerror-when-importing-paraview-simple/11879/2 "2023-04-17T07:45:03Z")

</div>

Thanks for the tip!

Note that PV is really sensitive on the VTK version used, and also on the Python version. That’s why:

- ParaView always comes with its own VTK embeded
- The binaries come with a `pvpython` executable, that ensure correct versions are loaded

Using another python interpreter is always tricky …
