Jump to: navigation, search

ImportError: DLL load failed

875 bytes added, 06:46, 27 November 2010
fix some typos
Now it is up to the user to diagnose what is wrong with his/her system and rectify it. Unfortunately since there have been multiple causes for the error in the past this can be quite difficult resulting in potential GRAMPS users to throw their hands up in disgust and give up, this page is solely to discuss possible methods to identify and fix the above problem.
In the above example, python tried to start was called passing in the script for GRAMPS , this is a complicated test case, so I'd like to try and simplify it to a minimal test case that exhibits the same behaviour. This minimal test case can then be used when testing if changes to the environment have had any effect on the problem. The minimal test case does not even use GRAMPS.
===Minimal Test Case===
Simply start a windows python command promptline.
{{man tip|Tip: |How to start Python 2.6 command line on Windows XP using the Start Menu <br> '''''Start -> All Programs-> Python 2.6 -> Python (Command Line)'''''}}
* [ Win32Api] Provides some ability to handle dos short path names that might be encountered in the path environment variable. This is a python library, download and install as you would any python library.
* [ Dependency Walker] Most importantly this program analyses and executableexecutables/DLL 's dependencies it is excellent for identifying missing DLL's. This is a zip file, download and expand the contents of the zip into the same directory that you will put saved the script 
Run the script from the windows command prompt and check the output of the script. Should you become stuck, cannot make head or tail of the output, then consider posting a description of your problem and the output of check_gtk_install on the [ GRAMPS Windows forum].
This snippit of output shows 3 DLL's whose line ends with '''Error dll not found''', after getting such a result, a little research online showed they are only are relevant for other versions of Windows and can safely be dismissed as a cause of the problem.
The two lines starting with ''' ERROR:''' are of more interest. These two DLL's should have been loaded from the gtk-runtime directory, however for whatever reason they have been found and loaded from c:\windows\system . In this case removing/renaming those two DLL's in the windows directory allowed python to correctly import gtk, hence GRAMPS was then able to work.
What had happened in the above case, although the two DLL's were found in windows\system, the gtk-runtime could not work with them as they were from an older installation, and not the correct version for the current gtk installation. In another example (below) you can see that some DLL's were found in other installation directories, this may or may not affect the ability of python to import gtk, it depends if the dll's in the other directories are compatible with what the gtk-runtime needs or not. In one case I had a perfectly working system, but it was picking up DLL's from other installations, in this case upgrading another program can suddenly break the gtk installation.  ==== Checking with Dependency Walker ==== Please be patient takes some time Testing file C:\Python26\Lib/site-packages/gtk-2.0/gtk/_gtk.pyd DWMAPI.DLL Error dll not found ERROR: c:\program files\graphviz2.26\bin\LIBGDK-WIN32-2.0-0.DLL Version ERROR: c:\program files\miktex 2.8\miktex\bin\MSVCR90.DLL Version 9.0.30729.1
Output from should be used as a guide to possible issues, it is possible for the script to give the thumbs up, but a problem still exists on the system.

Navigation menu