New import order dependency (gtk, gimpfu) in Python plugins on Windows
Since 2.10 (possibly 2.10.2) the import order of some things has become important in Python plugins. Formerly, the plugin could import gimpfu
after import gtk
, but now gimpfu
must be imported first, otherwise there is an error:
Traceback (most recent call last):
File "E:\Gimp\plugins\importorder.py", line 10, in <module>
import gtk
File "C:\Program Files\GIMP 2\32\lib\python2.7\site-packages\gtk-2.0/gtk/__init__.py", line 30, in <module>
import gobject as _gobject
File "C:\Program Files\GIMP 2\32\lib\python2.7\site-packages/gobject/__init__.py", line 47, in <module>
from gobject.constants import *
File "C:\Program Files\GIMP 2\32\lib\python2.7\site-packages/gobject/constants.py", line 24, in <module>
import gobject._gobject
ImportError: DLL load failed: One or more arguments are invalid
Can't help wondering if this is due to the presence of two different versions of libgtk-win32-2.0-0.dll
(and despite the name, one must e a 64-bit executable).
C:\Program Files\GIMP 2>dir libgtk* /s
Volume in drive C has no label.
Volume Serial Number is 4126-9DCC
Directory of C:\Program Files\GIMP 2\32\bin
05/05/2018 01:18 AM 4,363,504 libgtk-win32-2.0-0.dll
1 File(s) 4,363,504 bytes
Directory of C:\Program Files\GIMP 2\bin
04/28/2018 03:33 PM 6,268,701 libgtk-win32-2.0-0.dll
1 File(s) 6,268,701 bytes
Edited by ofnuts