I’m trying to add a python package that among other things needs webview, which in turn needs webkit2. I’d like to use it with GTK, but:
$ python
Python 3.11.5 (main, Aug 24 2023, 12:23:19) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import webview.platforms.gtk
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/nix/store/zk13adkl37daamv9mnkrz5bi76dc9zpz-python3-3.11.5-env/lib/python3.11/site-packages/webview/platforms/gtk.py", line 24, in <module>
gi.require_version('WebKit2', '4.0')
File "/nix/store/zk13adkl37daamv9mnkrz5bi76dc9zpz-python3-3.11.5-env/lib/python3.11/site-packages/gi/__init__.py", line 126, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace WebKit2 not available
>>>
Well, you could also modify the typelib path directly in the module but I would not recommend it unless there is no other choice, since it is a global change that will affect all other libraries loaded by the process.