[pygtk] Problem importing gtk
saeed.gnu at gmail.com
Wed Jul 29 00:02:31 WST 2009
System PATH is an Environment Variable (in the command line level and
the upper levels of OS such as graphical environment) containing the
list of directories that the Windows search in them to find executable
commands(EXEs) and shared libraries(DLLs), that the user(or programs)
can refer only to their name to run executable or use libraries (and
no need to refer the complete path of file). In Unix(and Linux), PATH
is about only executables not libraries, the libraries is seperated in
To change PATH in Windows:
Right click on the "My Computer" icon (on your desktop, or in the
Start menu), and click "Properties", to open window "System
Properties", then goto tab "Advanced" and click on button "Environment
Variables", then click on item "Path" and click button "Edit", then
append a character ";" and then the new directory to it(for example
append ";H:\Python25\glade\gtk+-bundle_2.14.7-20090119_win32" to it).
Finally click OK.
You can only access or edit PATH variable in the commmand line, using
You can also access it from python using os.getenv('path'), and edit
it using os.putenv('path', ...)
Sorry for my poor english!
On 7/28/09, Luis A. Bastiao Silva <luis.kop at gmail.com> wrote:
> Did you add the path below to PATH variable environment?
> Is there bin/ lib/ share/ etc in this directory?
> On Tue, Jul 28, 2009 at 12:49 PM, bob gailer <bgailer at gmail.com> wrote:
>> I followed the instructions to get PyGTK running on MS Windows.
>> "We recommend to install the GTK+ runtime using the official GTK+ bundle
>> <http://ftp.gnome.org/pub/GNOME/binaries/win32/gtk+/> (gtk+-bundle*.zip
>> files). To fully install this bundle you need to uncompress its contents
>> in a folder and manually add the /bin/ subfolder to the system path."
>> I put it in H:\Python25\glade\gtk+-bundle_2.14.7-20090119_win32
>> What is "system path"? I added it to the Windows Path; that did not help.
>> Then I added it to the Python path. Now I get:
>> import gtk
>> Traceback (most recent call last):
>> File "<interactive input>", line 1, in <module>
>> File "H:\Python25\Lib\site-packages\gtk-2.0\gtk\__init__.py", line 38,
>> in <module>
>> import gobject as _gobject
>> File "H:\Python25\Lib\site-packages\gtk-2.0\gobject\__init__.py", line
>> 30, in <module>
>> from gobject.constants import *
>> File "H:\Python25\lib\site-packages\gtk-2.0\gobject\constants.py", line
>> 22, in <module>
>> from _gobject import type_from_name
>> ImportError: DLL load failed: The specified module could not be found.
>> What do I do to fix that?
>> Bob Gailer
>> Chapel Hill NC
>> pygtk mailing list pygtk at daa.com.au
>> Read the PyGTK FAQ: http://faq.pygtk.org/
> Best Regards,
> Luís A. Bastião Silva
More information about the pygtk