# problem in "self"

**URL:** https://discourse.paraview.org/t/problem-in-self/2367
**Category:** Development
**Tags:** python
**Created:** [August 6, 2019, 11:23am UTC](https://discourse.paraview.org/t/problem-in-self/2367 "2019-08-06T11:23:33Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![ikram](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/i/7c8e57/32.png) [@ikram](https://discourse.paraview.org/u/ikram)
#### Post date: [August 6, 2019, 11:23am UTC](https://discourse.paraview.org/t/problem-in-self/2367/1 "2019-08-06T11:23:33Z")

</div>

hi how can i fix this problem  
File “”, line 1, in

NameError: name ‘self’ is not defined

---

<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: [August 6, 2019, 11:24am UTC](https://discourse.paraview.org/t/problem-in-self/2367/2 "2019-08-06T11:24:56Z")

</div>

please update your post with relevant information about your problem.

---

<div class="post-metadata">

### Author: ![ikram](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/i/7c8e57/32.png) [@ikram](https://discourse.paraview.org/u/ikram)
#### Post date: [August 6, 2019, 11:27am UTC](https://discourse.paraview.org/t/problem-in-self/2367/3 "2019-08-06T11:27:42Z")

</div>

i try to execute this code :  
from paraview.simple import \*  
from paraview import vtk  
reader = OpenDataFile(’/home/ikram/Bureau/C0002.vtk’)

pdi = self.GetPolyDataInput()  
pdo = self.GetPolyDataOutput()  
numPoints = pdi.GetNumberOfPoints()  
pdo.Allocate()  
for i in range(0, numPoints-1):  
points = [i, i+1]  
# VTK\_LINE is 3  
pdo.InsertNextCell(3, 2, points)

Show(reader)

but it bugs :  
NameError: name ‘self’ is not defined

how can i fix it

---

<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: [August 6, 2019, 11:29am UTC](https://discourse.paraview.org/t/problem-in-self/2367/4 "2019-08-06T11:29:51Z")

</div>

```
from paraview.simple import *
from paraview import vtk
reader = OpenDataFile(’/home/ikram/Bureau/C0002.vtk’)
Show(reader)

```

This part if pvpython code.

```
pdi = self.GetPolyDataInput()
pdo = self.GetPolyDataOutput()
numPoints = pdi.GetNumberOfPoints()
pdo.Allocate()
for i in range(0, numPoints-1):
points = [i, i+1]
# VTK_LINE is 3
pdo.InsertNextCell(3, 2, points)

```

This part is vtkPython, probably to put in a Programmable Filter. Are you trying to create lines between points ?

Looks like you are trying to put vtkPython code in pvpython or python shell. Is that the case ?

---

<div class="post-metadata">

### Author: ![ikram](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/i/7c8e57/32.png) [@ikram](https://discourse.paraview.org/u/ikram)
#### Post date: [August 6, 2019, 11:30am UTC](https://discourse.paraview.org/t/problem-in-self/2367/5 "2019-08-06T11:30:49Z")

</div>

yes !

---

<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: [August 6, 2019, 11:32am UTC](https://discourse.paraview.org/t/problem-in-self/2367/6 "2019-08-06T11:32:52Z")

</div>

So use your code in a ProgrammableFilter instead.

---

<div class="post-metadata">

### Author: ![ikram](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/i/7c8e57/32.png) [@ikram](https://discourse.paraview.org/u/ikram)
#### Post date: [August 6, 2019, 11:35am UTC](https://discourse.paraview.org/t/problem-in-self/2367/7 "2019-08-06T11:35:21Z")

</div>

> [@mwestphal](#):
>
> pvpython

how i do this ! sorry  
but i already start using paraview !

---

<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: [August 6, 2019, 11:41am UTC](https://discourse.paraview.org/t/problem-in-self/2367/8 "2019-08-06T11:41:47Z")

</div>

pvpython is available in ParaView

View -\> Python Shell

---

<div class="post-metadata">

### Author: ![ikram](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/i/7c8e57/32.png) [@ikram](https://discourse.paraview.org/u/ikram)
#### Post date: [August 6, 2019, 11:45am UTC](https://discourse.paraview.org/t/problem-in-self/2367/9 "2019-08-06T11:45:20Z")

</div>

i found python shell in tools , and i did run script test.py , it contains  
pdi = self.GetPolyDataInput()  
pdo = self.GetPolyDataOutput()  
numPoints = pdi.GetNumberOfPoints()  
pdo.Allocate()  
for i in range(0, numPoints-1):  
points = [i, i+1]  
# VTK\_LINE is 3  
pdo.InsertNextCell(3, 2, points)

but it show me this  
nameError: name ‘self’ is not defined  
😕 how can i fixe it

---

<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: [August 6, 2019, 11:48am UTC](https://discourse.paraview.org/t/problem-in-self/2367/10 "2019-08-06T11:48:43Z")

</div>

This code is for a programmable filter, not the python shell.

Filters -\> ProgrammableFilter

---

<div class="post-metadata">

### Author: ![ikram](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/i/7c8e57/32.png) [@ikram](https://discourse.paraview.org/u/ikram)
#### Post date: [August 6, 2019, 11:51am UTC](https://discourse.paraview.org/t/problem-in-self/2367/11 "2019-08-06T11:51:27Z")

</div>

ok  
i think is not installed !  
how can i fix it !

---

<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: [August 6, 2019, 11:52am UTC](https://discourse.paraview.org/t/problem-in-self/2367/12 "2019-08-06T11:52:30Z")

</div>

Download ParaView here:  
[https://www.paraview.org/download/](https://www.paraview.org/download/)

---

<div class="post-metadata">

### Author: ![ikram](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/i/7c8e57/32.png) [@ikram](https://discourse.paraview.org/u/ikram)
#### Post date: [August 6, 2019, 12:09pm UTC](https://discourse.paraview.org/t/problem-in-self/2367/13 "2019-08-06T12:09:09Z")

</div>

excuse me for my stupid question !  
i download ParaView-5.7.0-RC1-osmesa-MPI-Linux-64bit.tar.gz  
and i extracted it  
after that , how i install it !

---

<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: [August 6, 2019, 12:12pm UTC](https://discourse.paraview.org/t/problem-in-self/2367/14 "2019-08-06T12:12:37Z")

</div>

Just untar it somewhere and run paraview.

---

<div class="post-metadata">

### Author: ![ikram](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/i/7c8e57/32.png) [@ikram](https://discourse.paraview.org/u/ikram)
#### Post date: [August 6, 2019, 7:40pm UTC](https://discourse.paraview.org/t/problem-in-self/2367/15 "2019-08-06T19:40:14Z")

</div>

hi mathiew , i uninstall parview and reinstall it , and i have the same issue , no programmable filter !!  
how can i fixe it please ?

---

<div class="post-metadata">

### Author: ![ikram](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/i/7c8e57/32.png) [@ikram](https://discourse.paraview.org/u/ikram)
#### Post date: [August 6, 2019, 7:53pm UTC](https://discourse.paraview.org/t/problem-in-self/2367/16 "2019-08-06T19:53:30Z")

</div>

actually i fixed it , but when i click on apply of the programmable filter, the paraview shutdown !  
😕  
i need a solution please
