[cairo] Rendering SVG with libRSVG,Python ... CTYPES SUCCESS AT LAST!!!
tim_grove at sil.org
Tue Sep 2 23:08:50 CEST 2008
Thanks for your advice Gerdus, but I have tried your suggestion with no
success. It has at least been beneficial to discover a tool which I did
not know about in 'Dependency Walker'; all dependencies appear okay.
HOWEVER (!!!) I HAVE JUST HAD SUCCESS IN LOADING THE DLL !!! In
searching through my 'C:WINDOWS\system32' directory I discovered a
subdirectory named 'rsvg' containing a number of .dll's associated with
that library, including the ones I was attempting to load. I'm not
certain how it got there; I probably added it myself sometime in the
last couple of weeks in a vain attempt to solve the problem. In any
case, that directory seems to have been the root of my problems causing
some path conflicts, since when I deleted it my code ran fine! At last,
"l = CDLL('librsvg-2-2.dll')" works! Now to give the rest of your
solution a try...
Gerdus van Zyl wrote:
> I created that ctypes recipe since there is no binary for win32.
> The python binding for librsvg is part of gnome-python-desktop and as
> such you need
> a gtk build env which is pretty much impossible to get working. Plus
> the build system uses codegen/magic/amuletyendor so I can't even hand
> compile it. But if you have some linux development experience (I
> don't) you might get it working that way.
> On the ctypes problem from the ctypes list: Try putting all the dll
> files in the same directory as the script and then using Dependency
> Walker to ensure it's finding the dll dependencies in that directory.
> On Tue, Sep 2, 2008 at 7:24 PM, Tim Grove <tim_grove at sil.org> wrote:
>> In the recipe found at
>> http://www.cairographics.org/cookbook/librsvgpython/, the intro reads:
>> "Normally it's easier to use librsvg Python bindings from PyGTK, so you
>> can import rsvg. When that's not an option, you may be able to bind just
>> enough of it using the ctypes module to use it. Example for win32 follows."
>> I've been having trouble getting the actual recipe for ctypes working
>> (another story - visit the ctypes mailing list!!!), but I'm looking for
>> advice on how to get my pc setup (Windows XP Pro) so that I can use
>> "import rsvg" in my python program, as suggested by the intro. Can
>> anyone help?
>> cairo mailing list
>> cairo at cairographics.org
> cairo mailing list
> cairo at cairographics.org
More information about the Python-list