Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined variable from import when using vtk

I am coding in python 2.7 using python-vtk 6.2.0 installed with the Ubuntu package manager. I use eclipse + pydev as IDE and I can run the code successfully in shell and from within eclipse.

The only annoying problem I have is that the code analyser keeps posting errors of the type: Undefined variable from import: vtkxxxxxx whenever I do

import vtk

vtk.vtkTransformPolyDataFilter
vtk.vtkActor
vtk.vtkWhatever

I tried to reset the interpreter and I have also tried to manually add the library .so files to the PYTHONPATH, with no luck.

Also I can see the the vtk package in the project tree under system libs and I have no errors on the line import vtk

Is there a particular unusual way to include vtk library in pydev? Am I doing something stupid I do not see?

Thank you all!

like image 235
alexmogavero Avatar asked Feb 08 '17 16:02

alexmogavero


2 Answers

I have found a similar question already asked about numpy. It has been solved so maybe you might find your answer in there. The URL for the issue is https://stackoverflow.com/a/14082269/7171962

Btw. This may be of no help to you.

I hope this helps.

like image 61
Elodin Avatar answered Oct 16 '22 11:10

Elodin


had you gone through this link enter link description here

Hope this will help

like image 1
Anand Tripathi Avatar answered Oct 16 '22 10:10

Anand Tripathi