PIP packages with EGL?

I am using VTK offscreen rendering with EGL via Files :: Anaconda.org (e.g. linux-64/vtk-9.2.2-egl_py38h6ab77d2_4.tar.bz2), which works great.

However sometimes I would also like to set this up via pip, however AFAIK vtk · PyPI does not seem to include EGL - are there any plans to push the same packages also to pip?

As a background: some things are just a pain to setup with Conda because of the broken dependency solver (e.g. it complians SimpleITK would be “conflicting” with many other packages, which is not actually true) and the new “mamba” solver is still in development. I never saw such issues with pip, so it would be great to get VTK with EGL this way too. For now I am working around with different python envs, which is a poor mans solution …

@jcfr @ben.boeckel your are the maintainers of vtk · PyPI, right? Any plans for a pip release including EGL? Thanks!

It’s been discussed, yes. Not on a schedule AFAIK though.

Cc: @Sebastien_Jourdain @banesullivan

1 Like

Also, not sure about a PyPI release; it might have to be on a Kitware repo because of symbol conflict problems (AFAIK, we’d have to ship a Mesa build which I imagine crashes and burns if some other package tries to load a “real” OpenGL).

1 Like

Ping me in about 3 months and I think we may have something worked out for this.

In the meantime, I have been building OSMesa and EGL wheel variants manually. I have some hosted here and some (work in progress) scripts to build them here. These are very unofficial and are just what I’m using right now

1 Like

@banesullivan 3 months are over - any updates? :slight_smile:

Thanks for the reminder, @Ingmar! I’ve posted in a few places about the recent publishing of OSMesa wheels:

Unfortunately, we are not publishing EGL variants at this time but I have created some CMake configurations that make the process of building these wheels relatively straightforward: GitHub - banesullivan/vtk-cmake: CMake configurations for how I like to build VTK

1 Like

pip install --extra-index-url https://wheels.vtk.org vtk-egl

1 Like

thank you @Sebastien_Jourdain !

What would be the best way of searching https://wheels.vtk.org?
It looks minified in the browser (“only” the API responds) and pip search --index https://wheels.vtk.org vtk fails with:

ERROR: Exception:
Traceback (most recent call last):
  File "C:\Users\e04004t0\AppData\Roaming\Python\Python39\site-packages\pip\_internal\network\xmlrpc.py", line 50, in request
    raise_for_status(response)
  File "C:\Users\e04004t0\AppData\Roaming\Python\Python39\site-packages\pip\_internal\network\utils.py", line 54, in raise_for_status
    raise NetworkConnectionError(http_error_msg, response=resp)
pip._internal.exceptions.NetworkConnectionError: 404 Client Error: Not Found for url: https://pypi.org/simple/RPC2/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\e04004t0\AppData\Roaming\Python\Python39\site-packages\pip\_internal\cli\base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
  File "C:\Users\e04004t0\AppData\Roaming\Python\Python39\site-packages\pip\_internal\commands\search.py", line 57, in run
    pypi_hits = self.search(query, options)
  File "C:\Users\e04004t0\AppData\Roaming\Python\Python39\site-packages\pip\_internal\commands\search.py", line 77, in search
    hits = pypi.search({"name": query, "summary": query}, "or")
  File "E:\UserData\e04004t0\python-caches\conda\envs\USValves\lib\xmlrpc\client.py", line 1122, in __call__
    return self.__send(self.__name, args)
  File "E:\UserData\e04004t0\python-caches\conda\envs\USValves\lib\xmlrpc\client.py", line 1464, in __request
    response = self.__transport.request(
  File "C:\Users\e04004t0\AppData\Roaming\Python\Python39\site-packages\pip\_internal\network\xmlrpc.py", line 54, in request
    assert exc.response
AssertionError

It is an alias to https://gitlab.kitware.com/vtk/vtk/-/packages

1 Like

@Sebastien_Jourdain the vtk-egl installation fails on my end with

ERROR: Could not find a version that satisfies the requirement vtk-egl (from versions: none)
ERROR: No matching distribution found for vtk-egl

On the same machine I am able to install vtk and vtk-osmesa packages

It is for Python 3.9.19 on CentOS Linux release 7.9.2009 (Core) - should I try with a more recent python version?

nevermind I realized CentOS 7 is simply old (according to GitHub - pypa/manylinux: Python wheels that work on any linux (almost))

1 Like

Yes, I had attempted to use the same manylinux as the vtk wheels, but Mesa/LLVM were just not happy with the available libraries/toolchains.