Once again I have to program scientific software. But this time it has to run on a measuring computer with Windows. For this purpose I've installed WinPython 3.3.5 (32 bit) and PyGObject 3.12.2 with GTK+3.8.9 (32 bit).
WinPython Interpreter works:
Python 3.3.5 (v3.3.5:62cf4e77f785, Mar 9 2014, 10:37:12) [MSC v.1600 32 bit (In tel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys; print(sys.path) ['', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\python33.zip', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\DLLs', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\FontTools', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\win32', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\win32\\lib', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\Pythonwin'] >>> import gi >>>
WinPython Command Prompt works too:
C:\WinPython-32bit-3.3.5.0\python-3.3.5>echo %path% C:\WinPython-32bit-3.3.5.0\python-3.3.5\Lib\site-packages\PyQt4; C:\WinPython-32bit-3.3.5.0\python-3.3.5\; C:\WinPython-32bit-3.3.5.0\python-3.3.5\DLLs; C:\WinPython-32bit-3.3.5.0\python-3.3.5\Scripts; C:\WinPython-32bit-3.3.5.0\python-3.3.5\..\tools; C:\WinPython-32bit-3.3.5.0\python-3.3.5\..\tools\gnuwin32\bin; C:\MinGW\bin; C:\Windows\system32; C:\Windows;C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\WinPython-32bit-3.3.5.0\python-3.3.5\..\tools\TortoiseHg C:\WinPython-32bit-3.3.5.0\python-3.3.5>python Python 3.3.5 (v3.3.5:62cf4e77f785, Mar 9 2014, 10:37:12) [MSC v.1600 32 bit (In tel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import gi >>>
The normal Windows' cmd.exe works too:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.
C:\WinPython-32bit-3.3.5.0\python-3.3.5>echo %path% C:\MinGW\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\ System32\WindowsPowerShell\v1.0\ C:\WinPython-32bit-3.3.5.0\python-3.3.5>python Python 3.3.5 (v3.3.5:62cf4e77f785, Mar 9 2014, 10:37:12) [MSC v.1600 32 bit (In tel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys; print(sys.path) ['', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\python33.zip', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\DLLs', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\FontTools', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\win32', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\win32\\lib', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\Pythonwin'] >>> import gi >>>
But IPython Qt Console doesn't:
Python 3.3.5 (v3.3.5:62cf4e77f785, Mar 9 2014, 10:37:12) [MSC v.1600 32 bit (Intel)] Type "copyright", "credits" or "license" for more information. IPython 2.0.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. %guiref -> A brief reference about the graphical user interface. In [1]: import sys; print(sys.path) ['', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\python33.zip', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\DLLs', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\FontTools', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\win32', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\win32\\lib', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\Pythonwin', 'C:\\WinPython-32bit-3.3.5.0\\python-3.3.5\\lib\\site-packages\\IPython\\extensions', 'C:\\WinPython-32bit-3.3.5.0\\settings\\.ipython'] In [2]: import gi --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-2-a23efdcdbcd8> in <module>() ----> 1 import gi C:\WinPython-32bit-3.3.5.0\python-3.3.5\lib\site-packages\gi\__init__.py in <module>() 34 'of "import gobject" to "from gi.repository import GObject".') 35 ---> 36 from ._gi import _gobject 37 from ._gi import _API 38 from ._gi import Repository ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden. In [3]:
On the one hand iPython is very useful and on the other hand py2exe/cx_Freeze also doesn't find gi module on every console with similar message.
import gi
works in IPython from WinPython 3.3.2.3 (32 bit). No more time to try from which version it no longer works. Next step is to get GTK+3 working with cx_Freeze.