I tried to run such python codes:
import vtk
import numpy as np
arraySize = 81
lineArray = np.array([ 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0,
12, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 11,
12, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 22,
13, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 33,
13, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 45,
13, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 57],dtype = np.int64)
vtkIarr = vtk.vtkIdTypeArray()
vtkIarr.SetArray(lineArray,arraySize,1)
when I tried it on win 10 with python3, everything was ok.
But when I tried it on CentOS 8 with python3, it returned an error message as follows:
“vtkIarr.SetArray(lineArray,arraySize,1)
TypeError: SetArray argument 1: incorrect buffer type, expected q but received l”
This is quite strange to me. Can anyone help?