Re: [Rdkit-discuss] rdkit.Chem.Draw.spingCanvas.py (and py27 aggdraw / cairo help?)

2011-06-10 Thread Riccardo Vianello
Hi James,

On Thu, Jun 9, 2011 at 8:22 PM, James Davidson j.david...@vernalis.com wrote:
 [...]
 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

I don't know exactly about the other problems, but this one should be
related to the version of the installed PIL. If I remember correctly,
BGRA raw mode requires PIL 1.1.7.

Regards,
Riccardo

--
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


Re: [Rdkit-discuss] rdkit.Chem.Draw.spingCanvas.py (and py27 aggdraw / cairo help?)

2011-06-10 Thread James Davidson
Dear Greg, Riccardo, et al.


 Riccardo wrote:
 I don't know exactly about the other problems, but this one 
 should be related to the version of the installed PIL. If I 
 remember correctly, BGRA raw mode requires PIL 1.1.7.

@Riccardo - 
Thanks for the advice, Riccardo.  I think I was already on 1.1.7 - but
maybe an alpha release(?)  Anyway, I have now standardised across Python
2.6 and 2.7 with the latest PIL installers from
http://www.pythonware.com/products/pil/.


 Greg wrote: 
 I will try to do an aggdraw build for 2.7. If I succeed, I'll 
 post something.

@Greg -
Thanks for the kind offer.  I for one would be very pleased to be using
aggdraw again (as I think the image quality seems the best).  I am
pleased to say, however, that it is less critical now that I have worked
through my cairo issues!  : )


Previously I was getting:

Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit
(Intel)] on win32
Type copyright, credits or license() for more information.
 from rdkit import Chem
 from rdkit.Chem import AllChem, Draw
 mol = Chem.MolFromSmiles(c1c1)
 AllChem.Compute2DCoords(mol)
 im = Draw.MolToImage(mol)
!!!PYTHONW.EXE CRASH!!!


Finally, after a morning of going round in circles (and following
red-herring Dependency Walker trails(!)), things are running well; with
RDKit now happily calling cairo!  I thought it might be useful for
others to list the versions of software / DLLs that I finally found to
work:

Windows XP Pro. SP3 (32-bit)
Python 2.7.1 (http://www.python.org/ftp/python/2.7.1/python-2.7.1.msi)
PIL 1.1.7 (installer -
http://effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe)
Pycairo-1.8.10.win32-py2.7 (installer -
http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/pycairo-1.8.10
.win32-py2.7.exe)
Libcairo-2.dll (get from the following archive:
http://wxpython.org/cairo/cairo_1.8.6-1_win32.zip)
libpng12-0.dll (get from the following archive:
http://wxpython.org/cairo/libpng_1.2.34-1_win32.zip)
Zlib1.dll (get from the following archive:
http://wxpython.org/cairo/zlib123-dll.zip)

I then put the 3 DLLs into the C:\Python27\Lib\site-packages\cairo\
folder, and made sure that this is on the system path.  The use of the
wxPython DLLs seemed to be the key to sorting things out (I certainly
tried a few other versions!) - thanks to Alex Matan's blog-post for the
instructions
(http://electromagnetictelegraph.com/install-cairo-wxpyton-pycairo-pytho
n-windows)

The setup under 2.6 was exactly the same - except I used the
corresponding 2.6 installer for PIL, and used the
Pycairo-1.8.4.win32-py26 from the wxPython site
(http://wxpython.org/cairo/pycairo-1.8.4.win32-py2.6.exe) as detailed in
Alex's blog.


I can add these instructions to to the wiki if you like(?)

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


[Rdkit-discuss] Friday evening problem... Centos RDKit -- again

2011-06-10 Thread JP
I am installing the brand new RDKit (2011_03_2) on CentOS (lol!) on a Friday
evening (6.54pm here in Oxford)...  So I probably deserve the misery of the
following.

I have already gone through the whole RDKit on Centos installation procedure
and pain on other machines and I now am undaunted by it.  Bring it on.
Still I installed everything (almost) according to the book (
http://code.google.com/p/rdkit/wiki/BuildingOnCentOS) with the exception
that I stuck to Python 2.4.3 (Python 2.7, doesn't play nicely with Rocks)

And I get this anti-fancy error message

 from rdkit import Chem
Traceback (most recent call last):
  File stdin, line 1, in ?
  File /share/apps/RDKit_2011_03_2/rdkit/Chem/__init__.py, line 18, in ?
from rdkit import rdBase
ImportError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found
(required by /share/apps/RDKit_2011_03_2/rdkit/rdBase.so)

Any ideas?

[jp@xxx build]$ echo $LD_LIBRARY_PATH
/share/apps/RDKit_2011_03_2/lib:/share/apps/boost_1_46_1/lib:/opt/gridengine/lib/lx26-amd64:/share/apps/openbabel/lib:/usr/local/lib:/share/apps/openbabel/lib:

[jp@xxx build]$ echo $PYTHONPATH
:/share/apps/RDKit_2011_03_2

[jp@xxx build]$ echo $RDBASE
/share/apps/RDKit_2011_03_2

Any sympathy will be greatly appreciated.

Cheers
JP
--
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


Re: [Rdkit-discuss] Friday evening problem... Centos RDKit -- again

2011-06-10 Thread Robert DeLisle
I will defer to Greg's expertise for a more accurate answer, but I would
suspect that the problem is the difference in using the system version of
Python and a version of RDKit that is built with a newer version of GCC.
You may be getting stuck in  dependency confusion between the two versions.

You should be able to build and install Python 2.7 without disturbing the
system's Python 2.4.3.

-Kirk






On Fri, Jun 10, 2011 at 12:00 PM, JP jeanpaul.ebe...@inhibox.com wrote:

 I am installing the brand new RDKit (2011_03_2) on CentOS (lol!) on a
 Friday evening (6.54pm here in Oxford)...  So I probably deserve the misery
 of the following.

 I have already gone through the whole RDKit on Centos installation
 procedure and pain on other machines and I now am undaunted by it.  Bring it
 on.
 Still I installed everything (almost) according to the book (
 http://code.google.com/p/rdkit/wiki/BuildingOnCentOS) with the exception
 that I stuck to Python 2.4.3 (Python 2.7, doesn't play nicely with Rocks)

 And I get this anti-fancy error message

  from rdkit import Chem
 Traceback (most recent call last):
   File stdin, line 1, in ?
   File /share/apps/RDKit_2011_03_2/rdkit/Chem/__init__.py, line 18, in ?
 from rdkit import rdBase
 ImportError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found
 (required by /share/apps/RDKit_2011_03_2/rdkit/rdBase.so)

 Any ideas?

 [jp@xxx build]$ echo $LD_LIBRARY_PATH

 /share/apps/RDKit_2011_03_2/lib:/share/apps/boost_1_46_1/lib:/opt/gridengine/lib/lx26-amd64:/share/apps/openbabel/lib:/usr/local/lib:/share/apps/openbabel/lib:

 [jp@xxx build]$ echo $PYTHONPATH
 :/share/apps/RDKit_2011_03_2

 [jp@xxx build]$ echo $RDBASE
 /share/apps/RDKit_2011_03_2

 Any sympathy will be greatly appreciated.

 Cheers
 JP


 --
 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


--
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


Re: [Rdkit-discuss] Friday evening problem... Centos RDKit -- again

2011-06-10 Thread JP
Hi there Kirk,

Your suggestion was interesting to tinker with -- but it doesn't help my
specific case.

If I set the environment to work with python 2.7 (and RDKit), I break ROCKs
functionality which I need from time to time.
I do not want to stay switching between p2.4 and p2.7 in the same session...




On 10 June 2011 19:20, Robert DeLisle rkdeli...@gmail.com wrote:

 I will defer to Greg's expertise for a more accurate answer, but I would
 suspect that the problem is the difference in using the system version of
 Python and a version of RDKit that is built with a newer version of GCC.
 You may be getting stuck in  dependency confusion between the two versions.

 You should be able to build and install Python 2.7 without disturbing the
 system's Python 2.4.3.

 -Kirk






 On Fri, Jun 10, 2011 at 12:00 PM, JP jeanpaul.ebe...@inhibox.com wrote:

 I am installing the brand new RDKit (2011_03_2) on CentOS (lol!) on a
 Friday evening (6.54pm here in Oxford)...  So I probably deserve the misery
 of the following.

 I have already gone through the whole RDKit on Centos installation
 procedure and pain on other machines and I now am undaunted by it.  Bring it
 on.
 Still I installed everything (almost) according to the book (
 http://code.google.com/p/rdkit/wiki/BuildingOnCentOS) with the exception
 that I stuck to Python 2.4.3 (Python 2.7, doesn't play nicely with Rocks)

 And I get this anti-fancy error message

  from rdkit import Chem
 Traceback (most recent call last):
   File stdin, line 1, in ?
   File /share/apps/RDKit_2011_03_2/rdkit/Chem/__init__.py, line 18, in ?
 from rdkit import rdBase
 ImportError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found
 (required by /share/apps/RDKit_2011_03_2/rdkit/rdBase.so)

 Any ideas?

 [jp@xxx build]$ echo $LD_LIBRARY_PATH

 /share/apps/RDKit_2011_03_2/lib:/share/apps/boost_1_46_1/lib:/opt/gridengine/lib/lx26-amd64:/share/apps/openbabel/lib:/usr/local/lib:/share/apps/openbabel/lib:

 [jp@xxx build]$ echo $PYTHONPATH
 :/share/apps/RDKit_2011_03_2

 [jp@xxx build]$ echo $RDBASE
 /share/apps/RDKit_2011_03_2

 Any sympathy will be greatly appreciated.

 Cheers
 JP


 --
 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



--
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


Re: [Rdkit-discuss] Friday evening problem... Centos RDKit -- again

2011-06-10 Thread JP
It seems someone got it to work with python 2.4 on Centos
(at least according to http://code.google.com/p/rdkit/wiki/WorkingBuilds).
 But even this is god knows how many permutations (gcc / boost / mpfr / gmp
/ bison / flex etc) away from mine...

I'd be interested in Greg's take on supported platforms.

What a start to the weekend!


On 10 June 2011 20:04, Robert DeLisle rkdeli...@gmail.com wrote:

 I can't blame you there.  One ring to bind them would be preferred.

 Have you searched the RDKit discussion list archives regarding Python
 version compatibility?  I vaguely remember something about older versions of
 Python in general, but I don't know if it applies to this case.






 On Fri, Jun 10, 2011 at 1:00 PM, JP jeanpaul.ebe...@inhibox.com wrote:


 Hi there Kirk,

 Your suggestion was interesting to tinker with -- but it doesn't help my
 specific case.

 If I set the environment to work with python 2.7 (and RDKit), I break
 ROCKs functionality which I need from time to time.
 I do not want to stay switching between p2.4 and p2.7 in the same
 session...




 On 10 June 2011 19:20, Robert DeLisle rkdeli...@gmail.com wrote:

 I will defer to Greg's expertise for a more accurate answer, but I would
 suspect that the problem is the difference in using the system version of
 Python and a version of RDKit that is built with a newer version of GCC.
 You may be getting stuck in  dependency confusion between the two versions.

 You should be able to build and install Python 2.7 without disturbing the
 system's Python 2.4.3.

 -Kirk






 On Fri, Jun 10, 2011 at 12:00 PM, JP jeanpaul.ebe...@inhibox.comwrote:

 I am installing the brand new RDKit (2011_03_2) on CentOS (lol!) on a
 Friday evening (6.54pm here in Oxford)...  So I probably deserve the misery
 of the following.

 I have already gone through the whole RDKit on Centos installation
 procedure and pain on other machines and I now am undaunted by it.  Bring 
 it
 on.
 Still I installed everything (almost) according to the book (
 http://code.google.com/p/rdkit/wiki/BuildingOnCentOS) with the
 exception that I stuck to Python 2.4.3 (Python 2.7, doesn't play nicely 
 with
 Rocks)

 And I get this anti-fancy error message

  from rdkit import Chem
 Traceback (most recent call last):
   File stdin, line 1, in ?
   File /share/apps/RDKit_2011_03_2/rdkit/Chem/__init__.py, line 18, in
 ?
 from rdkit import rdBase
 ImportError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not
 found (required by /share/apps/RDKit_2011_03_2/rdkit/rdBase.so)

 Any ideas?

 [jp@xxx build]$ echo $LD_LIBRARY_PATH

 /share/apps/RDKit_2011_03_2/lib:/share/apps/boost_1_46_1/lib:/opt/gridengine/lib/lx26-amd64:/share/apps/openbabel/lib:/usr/local/lib:/share/apps/openbabel/lib:

 [jp@xxx build]$ echo $PYTHONPATH
 :/share/apps/RDKit_2011_03_2

 [jp@xxx build]$ echo $RDBASE
 /share/apps/RDKit_2011_03_2

 Any sympathy will be greatly appreciated.

 Cheers
 JP


 --
 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





--
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


Re: [Rdkit-discuss] Friday evening problem... Centos RDKit -- again

2011-06-10 Thread Robert DeLisle
Check the version of gcc fort that working build.  It may not match yours.
Not that it fixes your problem, unfortunately.
On Jun 10, 2011 1:14 PM, JP jeanpaul.ebe...@inhibox.com wrote:
 It seems someone got it to work with python 2.4 on Centos
 (at least according to http://code.google.com/p/rdkit/wiki/WorkingBuilds).
 But even this is god knows how many permutations (gcc / boost / mpfr / gmp
 / bison / flex etc) away from mine...

 I'd be interested in Greg's take on supported platforms.

 What a start to the weekend!


 On 10 June 2011 20:04, Robert DeLisle rkdeli...@gmail.com wrote:

 I can't blame you there. One ring to bind them would be preferred.

 Have you searched the RDKit discussion list archives regarding Python
 version compatibility? I vaguely remember something about older versions
of
 Python in general, but I don't know if it applies to this case.






 On Fri, Jun 10, 2011 at 1:00 PM, JP jeanpaul.ebe...@inhibox.com wrote:


 Hi there Kirk,

 Your suggestion was interesting to tinker with -- but it doesn't help my
 specific case.

 If I set the environment to work with python 2.7 (and RDKit), I break
 ROCKs functionality which I need from time to time.
 I do not want to stay switching between p2.4 and p2.7 in the same
 session...




 On 10 June 2011 19:20, Robert DeLisle rkdeli...@gmail.com wrote:

 I will defer to Greg's expertise for a more accurate answer, but I
would
 suspect that the problem is the difference in using the system version
of
 Python and a version of RDKit that is built with a newer version of
GCC.
 You may be getting stuck in dependency confusion between the two
versions.

 You should be able to build and install Python 2.7 without disturbing
the
 system's Python 2.4.3.

 -Kirk






 On Fri, Jun 10, 2011 at 12:00 PM, JP jeanpaul.ebe...@inhibox.com
wrote:

 I am installing the brand new RDKit (2011_03_2) on CentOS (lol!) on a
 Friday evening (6.54pm here in Oxford)... So I probably deserve the
misery
 of the following.

 I have already gone through the whole RDKit on Centos installation
 procedure and pain on other machines and I now am undaunted by it.
Bring it
 on.
 Still I installed everything (almost) according to the book (
 http://code.google.com/p/rdkit/wiki/BuildingOnCentOS) with the
 exception that I stuck to Python 2.4.3 (Python 2.7, doesn't play
nicely with
 Rocks)

 And I get this anti-fancy error message

  from rdkit import Chem
 Traceback (most recent call last):
 File stdin, line 1, in ?
 File /share/apps/RDKit_2011_03_2/rdkit/Chem/__init__.py, line 18, in
 ?
 from rdkit import rdBase
 ImportError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not
 found (required by /share/apps/RDKit_2011_03_2/rdkit/rdBase.so)

 Any ideas?

 [jp@xxx build]$ echo $LD_LIBRARY_PATH


/share/apps/RDKit_2011_03_2/lib:/share/apps/boost_1_46_1/lib:/opt/gridengine/lib/lx26-amd64:/share/apps/openbabel/lib:/usr/local/lib:/share/apps/openbabel/lib:

 [jp@xxx build]$ echo $PYTHONPATH
 :/share/apps/RDKit_2011_03_2

 [jp@xxx build]$ echo $RDBASE
 /share/apps/RDKit_2011_03_2

 Any sympathy will be greatly appreciated.

 Cheers
 JP



--
 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





--
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


Re: [Rdkit-discuss] Friday evening problem... Centos RDKit -- again

2011-06-10 Thread Greg Landrum
Hi

On Friday, June 10, 2011, JP jeanpaul.ebe...@inhibox.com wrote:
 I am installing the brand new RDKit (2011_03_2) on CentOS (lol!) on a Friday 
 evening (6.54pm here in Oxford)...  So I probably deserve the misery of the 
 following.

Nobody deserves the misery of working with Centos. ;-)

 I have already gone through the whole RDKit on Centos installation procedure 
 and pain on other machines and I now am undaunted by it.  Bring it on.

Good attitude!


 Still I installed everything (almost) according to the book 
 (http://code.google.com/p/rdkit/wiki/BuildingOnCentOS) with the exception 
 that I stuck to Python 2.4.3 (Python 2.7, doesn't play nicely with Rocks)


 And I get this anti-fancy error message
 from rdkit import ChemTraceback (most recent call last):  File stdin, 
 line 1, in ?

   File /share/apps/RDKit_2011_03_2/rdkit/Chem/__init__.py, line 18, in ?    
 from rdkit import rdBaseImportError: /usr/lib64/libstdc++.so.6: version 
 `GLIBCXX_3.4.9' not found (required by 
 /share/apps/RDKit_2011_03_2/rdkit/rdBase.so)

That is a glibc problem. It means that you are using something that
has been built with a version of g++ that is more modern than the
version of libstdc++ (I think) that is being found. You might want to
google around a little bit for the error message in combination with
centos and see what you can find. Believe it or not, this doesn't have
much to do with the rdkit.

-greg



 Any ideas?
 [jp@xxx build]$ echo 
 $LD_LIBRARY_PATH/share/apps/RDKit_2011_03_2/lib:/share/apps/boost_1_46_1/lib:/opt/gridengine/lib/lx26-amd64:/share/apps/openbabel/lib:/usr/local/lib:/share/apps/openbabel/lib:


 [jp@xxx build]$ echo $PYTHONPATH     :/share/apps/RDKit_2011_03_2
 [jp@xxx build]$ echo $RDBASE    /share/apps/RDKit_2011_03_2


 Any sympathy will be greatly appreciated.
 CheersJP


--
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


Re: [Rdkit-discuss] Friday evening problem... Centos RDKit -- again

2011-06-10 Thread Robert DeLisle
Greg and JP,

For my own education, could this be related to having upgraded GCC through
the CentOS install instructions, but using the old Python?  The new version
of RDKit would have been built with the newer GCC but the old Python may not
refer to the correct libraries?

Or am I mixing concepts here?

-Kirk





On Fri, Jun 10, 2011 at 1:30 PM, Greg Landrum greg.land...@gmail.comwrote:

 Hi

 On Friday, June 10, 2011, JP jeanpaul.ebe...@inhibox.com wrote:
  I am installing the brand new RDKit (2011_03_2) on CentOS (lol!) on a
 Friday evening (6.54pm here in Oxford)...  So I probably deserve the misery
 of the following.

 Nobody deserves the misery of working with Centos. ;-)

  I have already gone through the whole RDKit on Centos installation
 procedure and pain on other machines and I now am undaunted by it.  Bring it
 on.

 Good attitude!

 
  Still I installed everything (almost) according to the book (
 http://code.google.com/p/rdkit/wiki/BuildingOnCentOS) with the exception
 that I stuck to Python 2.4.3 (Python 2.7, doesn't play nicely with Rocks)
 
 
  And I get this anti-fancy error message
  from rdkit import ChemTraceback (most recent call last):  File
 stdin, line 1, in ?
 
File /share/apps/RDKit_2011_03_2/rdkit/Chem/__init__.py, line 18, in
 ?from rdkit import rdBaseImportError: /usr/lib64/libstdc++.so.6: version
 `GLIBCXX_3.4.9' not found (required by
 /share/apps/RDKit_2011_03_2/rdkit/rdBase.so)

 That is a glibc problem. It means that you are using something that
 has been built with a version of g++ that is more modern than the
 version of libstdc++ (I think) that is being found. You might want to
 google around a little bit for the error message in combination with
 centos and see what you can find. Believe it or not, this doesn't have
 much to do with the rdkit.

 -greg

 
 
  Any ideas?
  [jp@xxx build]$ echo
 $LD_LIBRARY_PATH/share/apps/RDKit_2011_03_2/lib:/share/apps/boost_1_46_1/lib:/opt/gridengine/lib/lx26-amd64:/share/apps/openbabel/lib:/usr/local/lib:/share/apps/openbabel/lib:
 
 
  [jp@xxx build]$ echo $PYTHONPATH :/share/apps/RDKit_2011_03_2
  [jp@xxx build]$ echo $RDBASE/share/apps/RDKit_2011_03_2
 
 
  Any sympathy will be greatly appreciated.
  CheersJP
 


 --
 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

--
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


[Rdkit-discuss] MolDrawing.registerCanvas('agg') missing in SVN

2011-06-10 Thread Donald Keidel
Hi,

Today I checked out the lastest version from the svn.  I took only the 
trunk and built this and ran a python script I used with a previous 
version to depict a molecule.  However, I received the following error:

AttributeError: type object 'MolDrawing' has no attribute 'registerCanvas'


I did the following in the python script much like the people at cinfony 
do to depict with aggdraw:

import os, sys, copy
from rdkit.Chem import rdDepictor
from rdkit import Geometry

from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem.Draw import MolDrawing
from rdkit.Chem.AvailDescriptors import descDict

import rdkit.DataStructs
import rdkit.Chem.MACCSkeys
import rdkit.Chem.AtomPairs.Pairs
import rdkit.Chem.AtomPairs.Torsions

# PIL and Tkinter
try:
 import Tkinter as tk
 import Image as PIL
 import ImageTk as PILtk
except:
 PILtk = None

# Aggdraw
try:
 import aggdraw
except ImportError:
 aggdraw = None


def draw(Mol, show=True, filename=None, update=False, usecoords=False, 
width=300, height=300, background='white', atoms='color'):
 Create a 2D depiction of the molecule.  This method was taken 
from cinfony.

 Optional parameters:
   show -- display on screen (default is True)
   filename -- write to file (default is None)
   update -- update the coordinates of the atoms to those
 determined by the structure diagram generator
 (default is False)
   usecoords -- don't calculate 2D coordinates, just use
the current coordinates (default is False)

 Aggdraw is used for 2D depiction. Tkinter and
 Python Imaging Library are required for image display.
 Python code found at:  /usr/local/RDKit_2010_12_1/rdkit
 
 if usecoords:
 confId = 0
 else:
 if update:
 AllChem.Compute2DCoords(Mol)
 confId = 0
 else:
 confId = Mol.GetNumConformers()
 AllChem.Compute2DCoords(Mol, clearConfs = False)
 if show or filename:
 if not aggdraw:
 errormessage = (Aggdraw not found, but is required for 2D
 structure depiction. 
 See installation instructions for more 
 information.)
 raise ImportError, errormessage

 Chem.Kekulize(Mol)
 MolDrawing.registerCanvas('agg')
 import pdb;pdb.set_trace()
 img = PIL.new(RGBA,(width,height),background)
 canvas = aggdraw.Draw(img)
 canvas.setantialias(True)
 drawer = MolDrawing.MolDrawing(canvas)
 MolDrawing.elemDict
 if atoms == 'color' and background == 'white' :
 print 'Color on white'
 MolDrawing.elemDict[6] = (0,0,0)
 elif atoms == 'color' and background == 'black':
 print 'Color on black'
 MolDrawing.elemDict[6] = (1,1,1)
 elif atoms == 'white' and background == 'black':
 print 'White on black'
 MolDrawing.elemDict = {
 16: (0,0,0),
 17: (0,0,0),
 35: (0,0,0),
 6: (1,1,1),
 0: (0,0,0),
 7: (0,0,0),
 8: (0,0,0),
 9: (0,0,0),
 15: (0,0,0)
 }
 elif atoms == 'black' and background == 'white':
 print 'Black on white'
 MolDrawing.elemDict = {
 16: (0,0,0),
 17: (0,0,0),
 35: (0,0,0),
 6: (0,0,0),
 0: (0,0,0),
 7: (0,0,0),
 8: (0,0,0),
 9: (0,0,0),
 15: (0,0,0)
 }
 drawer.wedgeDashedBonds = True
 drawer.bondLineWidth = 2.5
 drawer.AddMol(Mol, confId = confId)
 canvas.flush()

 if filename: # Note: overwrite is allowed
 img.save(filename)
 if show:
 if not tk:
 errormessage = (Tkinter or Python Imaging 
 Library not found, but is required for 
image 
 display. See installation instructions 
for 
 more information.)
 raise ImportError, errormessage
 root = tk.Tk()
 root.title((hasattr(Mol, title) and Mol.title)
or Mol.__str__().rstrip())
 frame = tk.Frame(root, colormap=new, 
visual='truecolor').pack()
 imagedata = PILtk.PhotoImage(img)
 label = tk.Label(frame, image=imagedata).pack()
 quitbutton = tk.Button(root, text=Close, 
command=root.destroy).pack(fill=tk.X)
 root.mainloop()
 Chem.SanitizeMol(Mol)



Sorry for all the code, but I think much of it is relevant so I pasted 
it here.

Is the registerCanvas method removed from newer version?  If so how can 
I modify my Draw function so that it will work with the newest version 
from svn?

Thank you for any help.

Don





--
EditLive Enterprise is the