Python vtk problem

I run openSUSE 12.2 (64-bit) KDE. Using the openSUSE 12.2 Repo Index of /repositories/devel:/languages:/python/openSUSE_12.2 I installed the python-vtk (+python-vtk-qt) package but when I try to import the library within Python I get a runtime error:

Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import vtk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/vtk/__init__.py", line 127, in <module>
    from qvtk import *                                                                                                                                    
  File "/usr/lib/python2.7/site-packages/vtk/qvtk.py", line 8, in <module>                                                                                
    from QVTKPython import *                                                                                                                              
RuntimeError: the sip module implements API v8.0 to v8.1 but the vtk.QVTKPython module requires API v9.1    

I would be grateful if anyone could identify which package I need to update!

On Fri, 30 Nov 2012 18:06:02 +0000, flymail wrote:

> RuntimeError: the sip module implements API v8.0 to v8.1 but the
> vtk.QVTKPython module requires API v9.1
>
> --------------------
>
>
> I would be grateful if anyone could identify which package I need to
> update!

The runtime error above indicates that it’s the sip module that needs to
be updated. It’s the module that implements the outdated API.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Thanks Jim. I didn’t realise the GNU oSIP was insufficient. I installed python-sip-bin package and the import works perfectly.

EDIT: Thanks also Martin - I didn’t see your post until after I posted this one :).

I think you need a newer python-sip package.


PC: oS 12.2 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.8.5 | GTX 650 Ti
ThinkPad E320: oS 12.2 x86_64 | i3@2.30GHz | 8GB | KDE 4.9.3 | HD 3000
eCAFE 800: oS 11.4 i586 | AMD Geode LX 800@500MHz | 512MB | lamp server

On Fri, 30 Nov 2012 18:26:02 +0000, flymail wrote:

> hendersj;2507897 Wrote:
>>
>> The runtime error above indicates that it’s the sip module that needs
>> to be updated. It’s the module that implements the outdated API.
>>
>>
> Thanks Jim. I didn’t realise the GNU oSIP was insufficient. I installed
> python-sip-bin package and the import works perfectly.

Glad that got it working - I’m about 3 weeks into Python myself, finding
it to be a very good language to work with. :slight_smile:

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

+1 - great high-level language! Combine it with C++ and inline assembler and you’re unstoppable :smiley: !

I’ve been tinkering with Python for over two years and you’re telling me what to do after your three weeks :slight_smile: !

On Fri, 30 Nov 2012 19:06:01 +0000, flymail wrote:

> hendersj;2507906 Wrote:
>> Glad that got it working - I’m about 3 weeks into Python myself,
>> finding it to be a very good language to work with. :slight_smile:
>>
>>
> +1 - great high-level language! Combine it with C++ and inline assembler
> and you’re unstoppable :smiley: !
>
> I’ve been tinkering with Python for over two years and you’re telling me
> what to do after your three weeks :slight_smile: !

LOL

It has a lot of interesting capabilities - I picked up a couple of the
O’Reilly books, but I asked a developer I’m doing some work with what
he’d use for XML manipulation, and he said Python, so I checked it out.
Took a little bit to remember some of my old OOP programming courses from
college, but things are clicking back into place.

Sounds like you have a similar background in languages to mine - if
you’re doing C++ and inline assembly. :slight_smile: I’ve worked in probably a
couple dozen languages over the years, so new languages are just about
picking up syntax for me, in general - but my OOP experience was limited
to very early C++ (when it was translated to C by a precompiler and then
compiled) and Ada pre-Ada95.

I’m really liking the simplicity, flexibility, and extensibility.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

I think Python’s implementation of OOP is a little simplistic. For example classes can’t have private member data or protected member functions. Another woeful omission is any equivalent of switch-case branch syntax - the `dictionary method’ is highly restrictive.

Yes :), but I really don’t like the clunky AT&T syntax preferred by the gcc compiler.

Originally I was dragged kicking and screaming into Python after having previously used MATLAB for scientific calculations, since they introduced the numeric package NumPy which accelerates floating point array operations using LAPACK/BLAS. And I haven’t looked back since. I just wonder where the world is going on the use of Python 3…

On Sun, 02 Dec 2012 06:36:01 +0000, flymail wrote:

> hendersj;2507917 Wrote:
>> Took a little bit to remember some of my old OOP programming courses
>> from college, but things are clicking back into place.
>
> I think Python’s implementation of OOP is a little simplistic. For
> example classes can’t have private member data or protected member
> functions. Another woeful omission is any equivalent of switch-case
> branch syntax - the `dictionary method’ is highly restrictive.

Yeah, but for a scripting language it’s still not bad. I also ran into
the issue with a lack of switch/case (funny you should mention that, I
had wanted to do that as I evaluated different tags in the input XML
document).

> hendersj;2507917 Wrote:
>> <SNIP>I’m really liking the simplicity, flexibility, and extensibility.
>
> Originally I was dragged kicking and screaming into Python after having
> previously used MATLAB for scientific calculations, since they
> introduced the numeric package NumPy which accelerates floating point
> array operations using LAPACK/BLAS. And I haven’t looked back since. I
> just wonder where the world is going on the use of Python 3…

I had done a little bit of work in XML parsing in AWK - that
was…interesting. <g> What I’ve been doing is taking documentation
written in a doc tool, exported to a variant of docbook, and
restructuring it.

Been an interesting project - and finding good documentation on lxml.etree
has been interesting (the official site isn’t bad, but I’d like to see a
list of all the methods with summaries and examples, and many of the
methods are missing useful examples, I find).

Maybe I’ll have to learn it well enough to write my own book. :slight_smile:

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C