Hi James,
On Thu, Jun 9, 2011 at 8:22 PM, James Davidson <[email protected]> wrote:
>
> I am in the process of upgrading to python 2.7 under Windows, and part of
> this has included moving to the RDKit_2011_03_2 (py27) build. I had
> previously done most work with earlier versions of RDKit under python 2.6,
> but have found a problem with calling Draw.MolToImage() with the latest
> RDKit binary for both py26 and py27:
>
> Traceback (innermost last):
> File "C:\Python26\lib\site-packages\Pmw\Pmw_1_3\lib\PmwBase.py", line
> 1747, in __call__
> return apply(self.func, args)
> File "C:\Python26\lib\site-packages\pmg_tk\startup\VerMOL.py", line 1188,
> in <lambda>
> command=lambda s=self:s.draw_ligand(self.modelling_chainlist.listbox,
> self.ligcanvas, self.smiles, '3D',200,200, 'modelling_lig_image'))
> File "C:\Python26\lib\site-packages\pmg_tk\startup\VerMOL.py", line 2871,
> in draw_ligand
> im = Draw.MolToImage(mol, size=(x,y))
> File "C:\Python26\RDKit_2011_03_2\rdkit\Chem\Draw\__init__.py", line 71,
> in MolToImage
> drawer.AddMol(mol,**kwargs)
> File "C:\Python26\RDKit_2011_03_2\rdkit\Chem\Draw\MolDrawing.py", line
> 361, in AddMol
> color=color,width=width,color2=color2)
> File "C:\Python26\RDKit_2011_03_2\rdkit\Chem\Draw\MolDrawing.py", line
> 190, in _drawBond
> dash=self.dash)
> File "C:\Python26\RDKit_2011_03_2\rdkit\Chem\Draw\MolDrawing.py", line
> 169, in _drawWedgedBond
> self.canvas.addCanvasDashedWedge(poly[0],poly[1],poly[2],color=color)
> File "C:\Python26\RDKit_2011_03_2\rdkit\Chem\Draw\spingCanvas.py", line
> 104, in addCanvasDashedWedge
> pts1 = _getLinePoints(p1,p2,dash)
> <type 'exceptions.NameError'>: global name '_getLinePoints' is not defined
>
>
> Not a big problem to sort - I think spingCanvas.addCanvasDashedWedge()
> should read:
>
> pts1 = self._getLinePoints(p1,p2,dash)
> pts2 = self._getLinePoints(p1,p3,dash)
>
> on lines 104, 105 instead of:
>
> pts1 = _getLinePoints(p1,p2,dash)
> pts2 = _getLinePoints(p1,p3,dash)
Correct you are. I just fixed this and checked it in (it was already
working for aggdraw and cairo in svn).
> Anyway, this is only a problem if spingCanvas is being called - which I
> think only happens as a last resort if aggdraw or cairo aren't found. So on
> that note, the reason I was calling spingCanvas was that I don't have a
> build of aggdraw for python 2.7, and I have found that when cairo/pycairo
> are available to python 2.7 I get a pythonw.exe Application Error at the
> point of calling Draw.MolToImage(). Under python 2.6 I thought I would see
> what would happen if I removed aggdraw to force cairo into play (different
> version of PIL, different version of cairo - not an ideal comparison!):
>
> File "C:\Python26\RDKit_2011_03_2\rdkit\Chem\Draw\__init__.py", line 54, in
> MolToImage
> canvas = Canvas(img)
> File "C:\Python26\RDKit_2011_03_2\rdkit\Chem\Draw\cairoCanvas.py", line
> 38, in __init__
> imgd = image.tostring("raw","BGRA")
> File "C:\Python26\lib\site-packages\PIL\Image.py", line 516, in tostring
> e = _getencoder(self.mode, encoder_name, args)
> File "C:\Python26\lib\site-packages\PIL\Image.py", line 389, in
> _getencoder
> return apply(encoder, (mode,) + args + extra)
> <type 'exceptions.SystemError'>: unknown raw mode
>
>
> If it helps, I can follow-up with more details on exact versions of DLLs,
> etc; but for now wondered if:
>
> (a) anybody had a version of aggdraw for windows, built with python 2.7?
I will try to do an aggdraw build for 2.7. If I succeed, I'll post something.
> (b) or any recommendations for reliable PIL / cairo / pycairo combinations
> for python 2.7 / windows?
can't help here... sorry.
-greg
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss