Dear All,
 
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)
 
 
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?
(b) or any recommendations for reliable PIL / cairo / pycairo
combinations for python 2.7 / windows?
 
Kind regards
 
 
James

______________________________________________________________________
PLEASE READ: This email is confidential and may be privileged. It is intended 
for the named addressee(s) only and access to it by anyone else is 
unauthorised. If you are not an addressee, any disclosure or copying of the 
contents of this email or any action taken (or not taken) in reliance on it is 
unauthorised and may be unlawful. If you have received this email in error, 
please notify the sender or postmas...@vernalis.com. Email is not a secure 
method of communication and the Company cannot accept responsibility for the 
accuracy or completeness of this message or any attachment(s). Please check 
this email for virus infection for which the Company accepts no responsibility. 
If verification of this email is sought then please request a hard copy. Unless 
otherwise stated, any views or opinions presented are solely those of the 
author and do not represent those of the Company.

The Vernalis Group of Companies
Oakdene Court
613 Reading Road
Winnersh, Berkshire
RG41 5UA.
Tel: +44 118 977 3133

To access trading company registration and address details, please go to the 
Vernalis website at www.vernalis.com and click on the "Company address and 
registration details" link at the bottom of the page..
______________________________________________________________________
------------------------------------------------------------------------------
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
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to