简体   繁体   中英

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!

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.

had you gone through this link enter link description here

Hope this will help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM