# Failed to Create Object Error

**URL:** https://discourse.paraview.org/t/failed-to-create-object-error/11702
**Category:** ParaView Support
**Created:** [March 24, 2023, 5:27pm UTC](https://discourse.paraview.org/t/failed-to-create-object-error/11702 "2023-03-24T17:27:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Joshua\_Vazquez](https://discourse.paraview.org/user_avatar/discourse.paraview.org/joshua_vazquez/32/11065_2.png) [@Joshua\_Vazquez](https://discourse.paraview.org/u/Joshua_Vazquez)
#### Post date: [March 24, 2023, 5:27pm UTC](https://discourse.paraview.org/t/failed-to-create-object-error/11702/1 "2023-03-24T17:27:55Z")

</div>

I’m using the binary version for Windows from [paraview.org](http://paraview.org/) 5.11.0

I loaded my python plugin into ParaView without any problems but when I try to load a data file using the plugin  
I get a “Failed to create object” error. How can I resolve this error so that I am able to read the data file properly.

![image](https://discourse.paraview.org/uploads/default/original/2X/6/67f333f335239d0d5b7c16b30fae4eae53a9eb17.png)

Here is the code I used for the plugin.

```plaintext
from vtkmodules.numpy_interface import dataset_adapter as dsa
from vtkmodules.vtkCommonDataModel import vtkDataSet
import numpy as np

@smproxy.reader(name="PythonHDFReader", label="Python-based HDF Reader",
                extensions="hdf", file_description="HDF files")
@smproperty.input(name="Input", port_index=0)
@smdomain.datatype(dataTypes=["vtkPointSet"])
@smdomain.xml("""<InputArrayDomain attribute_type="point" name="input_normal" number_of_components="3" />""")

class HDF5Reader(VTKPythonAlgorithmBase):
    def __init__ (self):
        super(). __init__ (nInputPorts=1, nOutputPorts=1, outputType="vtkPointSet")
        self.WarpFactor = 1.0
        self.NormalArray = ""

        return 1

    def RequestData(self, request, inInfo, outInfo):
        from vtkmodules.vtkCommonDataModel import imageToVTK
        from vtkmodules.numpy_interface import dataset_adapter as dsa
                
        output = vtkPolyData.GetData(outInfo)
          
        return 1
```

---

<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: [April 23, 2023, 8:24pm UTC](https://discourse.paraview.org/t/failed-to-create-object-error/11702/2 "2023-04-23T20:24:11Z")

</div>

> [@Joshua\_Vazquez](#):
>
> ` from vtkmodules.vtkCommonDataModel import imageToVTK`

What is `imageToVTK`? I don’t see anything with this name in VTK itself.

That said, it shouldn’t interfere with the ` __init__ ` since it is in `RequestData`. We should probably get this error to surface the Python exception that (probably) happened.

---

<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: [April 23, 2023, 8:30pm UTC](https://discourse.paraview.org/t/failed-to-create-object-error/11702/3 "2023-04-23T20:30:41Z")

</div>

> [@ben.boeckel](#):
>
> We should probably get this error to surface the Python exception that (probably) happened.

It seems we do using `PyErr_Print()` which means it’s probably sitting in a terminal (or ignored) somewhere. We should try to redirect this to ParaView’s logging APIs though.

---

<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: [April 23, 2023, 8:47pm UTC](https://discourse.paraview.org/t/failed-to-create-object-error/11702/4 "2023-04-23T20:47:27Z")

</div>

Issue filed: [https://gitlab.kitware.com/paraview/paraview/-/issues/22121](https://gitlab.kitware.com/paraview/paraview/-/issues/22121)
