Wednesday, January 31, 2018

VTK-8.1.0 wheels for all platforms on pypi!


I cannot believe it has been 6 years since my last blog post!  Anyway, I have some good news to announce here.

In the Python community, VTK has always been somewhat difficult to install (in comparison to pure Python packages). One has required to either use a specific package management tool or resort to source builds. This has been a major problem when trying to install tools that rely on VTK, like Mayavi.

During the SciPy 2017 conference held at Austin last year, a few of the Kitware developers, notably Jean-Christophe Fillion-Robin  (JC for short) and some of the VTK developers got together with some of us from the SciPy community and decided to try and put together wheels for VTK.

JC did the hard work of figuring this out and setting up a nice VTKPythonPackage during the sprints to make this process easy. As of last week (Jan 27, 2018) Mac OS X wheels were not supported. Last weekend, I finally got the time (thanks to Enthought) to play with JC's work. I figured out how to get the wheels working on OS X. With this, in principle, we could build VTK wheels on all the major platforms.

We decided to try and push wheels at least for the major VTK releases. This in itself would be a massive improvement in making VTK easier to install. Over the last few days, I have built wheels on Linux, OS X, and Windows. All of these are 64 bit wheels for VTK-8.1.0.

Now, VTK 8.x adds a c++11 dependency, and so we cannot build these versions of VTK for Python 2.7 on Windows.

So now we have 64 bit wheels on Windows for Python versions 3.5.x and 3.6.x.
Unfortunately, 3.4.x required a different Visual Studio installed and I lost patience setting things up on my Windows VM.

On Linux, we have 64 bit wheels for Python 2.7.x, 3.4.x, 3.5.x, and 3.6.x.

On MacOS, we have 64 bit wheels for Python 2.7.x, 3.4.x, 3.5.x, and 3.6.x.

So if you are using a 64 bit Python, you can now do

   $ pip install vtk

and have VTK-8.1.0 installed!

This is really nice to have and should hopefully make VTK and other tools a lot easier to install.

A big thank you to JC, the other Kitware developers, the VTK Python developers, especially David Gobbi who has worked on the VTK Python wrappers for many many years now,  for making this happen. Apologies if I missed anyone but thank you all!

Enjoy!

8 comments:

Pankaj said...

This is great, and thanks for all the work. Finally we can expect mayavi to be just pip-installable.

Jellby said...

That's great, but on Ubuntu 14.04, with python 2.7.6 or 3.4.3 I get:

Downloading/unpacking vtk
Could not find any downloads that satisfy the requirement vtk
Cleaning up...
No distributions at all found for vtk
Storing debug log for failure in /home/ignacio/.pip/pip.log

and the log says it skips all wheels because they are "not compatible with this Python".

Jellby said...

It was just a matter of upgrading pip ("pip install --upgrade --user pip") and using the new version instead of the system one ("python -m pip ..." and not "pip ...").

Shailendra said...

This information you provided in the blog that is really unique I love it!! Thanks for sharing such a great blog. Keep posting..
Python training
Python Course
Python training institute

test said...

Mr. Ramachandran, Thank you for your efforts.

I have python 2.7 and 3.5 installed on my Centos 7 system. I ran 'pip3 install vtk' and it is only working for version 2.7. I get an OpenGL error with 3.5:

ERROR: In /work/standalone-x64-build/VTK-source/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 797
vtkXOpenGLRenderWindow (0x18f1c10): GL version 2.1 with the gpu_shader4 extension is not supported by your graphics driver but is required for the new OpenGL rendering backend. Please update your OpenGL driver. If you are using Mesa please make sure you have version 10.6.5 or later and make sure your driver in Mesa supports OpenGL 3.2.

glxinfo reports:
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.6, 128 bits)
OpenGL version string: 2.1 Mesa 10.6.5
OpenGL shading language version string: 1.30

Thank you.

test said...

MESA_GL_VERSION_OVERRIDE=3.3 /path/to/executable

https://stackoverflow.com/questions/50659162/python3-pip-install-vtk-opengl2-error/50689108#50689108

Unknown said...

Hi,

thanks for your hard work! Unfortunately I seem to need exactly the version of wheels that you were not able to generate, namely vtk 8 for Python 2.7 on Windows. You say that this was due to c++11 dependencies. Could you explain a bit more of the problem of compiling this under windows? Any chances you see a way forward?

/Daniel



Unknown said...

Thanks for your wonderful work making VTK available on PyPI. Any chance that you / your team could make wheels available for Python 3.7 now that it is available?