Discussion:
[Open Babel] Error when using compound.draw() in pybel installed by conda - PNG depiction support not found.
Hongbin Yang
2017-05-31 09:06:16 UTC
Permalink
Hi£¬
I installed openbabel via `conda install -c openbabel openbabel`.
I wanted to draw the molecule like`pybel.readstring('smi','c1ccccc1').draw()`
Then the error was raised:?C:\Users\yanya\Anaconda2\lib\site-packages\pybel.pyc in draw(self, show, filename, update, usecoords)

615 formatok = obconversion.SetOutFormat("_png2")

616 if not formatok:

--> 617 raise ImportError("PNG depiction support not found. You should "

618 "compile Open Babel with support for Cairo. See "

619 "installation instructions for more "



ImportError: PNG depiction support not found. You should compile Open Babel with support for Cairo. See installation instructions for more information.
The installed packages includes:libpng 1.6.28 vc9_0 [vc9] conda-forgepillow 4.0.0 py27_0pycairo 1.10.0 <pip>openbabel 2.4.1 py27_2 openbabelcairo 1.14.6 vc9_4 [vc9] conda-forge
I have both pillow and (py)cairo. Why can't I draw the molecule ?I guess that if I followed the suggestion and compile it with suport cairo it will work. But I have to work with conda. Is there any better way?
Sincerely,?


Hongbin Yang Ñîºë±ö

Research: Toxicophore and Chemoinformatics
Pharmaceutical Science, School of Pharmacy

East China University of Science and Technology?
Maciek Wójcikowski
2017-05-31 09:21:25 UTC
Permalink
Hi,

PNG is not supported yet on Windows - Openbabel was not compiled with it,
as there is no cairo package on Anaconda main channel for windows (note
you're using conda-forge).

Unfortunately this is also the case in bioconda, so for now there is no
better conda solution yet. I will revisit this issue and try to support PNG
files.

----
Pozdrawiam, | Best regards,
Maciek Wójcikowski
Post by Hongbin Yang
Hi
I installed openbabel via `conda install -c openbabel openbabel`.
I wanted to draw the molecule like
`pybel.readstring('smi','c1ccccc1').draw()`
C:\Users\yanya\Anaconda2\lib\site-packages\pybel.pyc in draw(self, show,
filename, update, usecoords)
615 formatok = obconversion.SetOutFormat("_png2")
--> 617 raise ImportError("PNG depiction support not found. You should "
618 "compile Open Babel with support for Cairo. See "
619 "installation instructions for more "
ImportError: PNG depiction support not found. You should compile Open
Babel with support for Cairo. See installation instructions for more
information.
libpng 1.6.28 vc9_0 [vc9] conda-forge
pillow 4.0.0 py27_0
pycairo 1.10.0 <pip>
openbabel 2.4.1 py27_2 openbabel
cairo 1.14.6 vc9_4 [vc9] conda-forge
I have both pillow and (py)cairo. Why can't I draw the molecule ?
I guess that if I followed the suggestion and compile it with suport cairo
it will work. But I have to work with conda. Is there any better way?
Sincerely,
------------------------------
Hongbin Yang 杚匘実
Research: Toxicophore and Chemoinformatics
Pharmaceutical Science, School of Pharmacy
East China University of Science and Technology
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Noel O'Boyle
2017-05-31 11:16:28 UTC
Permalink
That's a pity. In the meanwhile, you can still create SVG images if
you choose this a write format, and pysvg might be able to convert to
PNG (?).
Hi,
PNG is not supported yet on Windows - Openbabel was not compiled with it, as
there is no cairo package on Anaconda main channel for windows (note you're
using conda-forge).
Unfortunately this is also the case in bioconda, so for now there is no
better conda solution yet. I will revisit this issue and try to support PNG
files.
----
Pozdrawiam, | Best regards,
Maciek Wójcikowski
Post by Hongbin Yang
Hi,
I installed openbabel via `conda install -c openbabel openbabel`.
I wanted to draw the molecule like
`pybel.readstring('smi','c1ccccc1').draw()`
C:\Users\yanya\Anaconda2\lib\site-packages\pybel.pyc in draw(self, show,
filename, update, usecoords)
615 formatok = obconversion.SetOutFormat("_png2")
--> 617 raise ImportError("PNG depiction support not found. You should "
618 "compile Open Babel with support for Cairo. See "
619 "installation instructions for more "
ImportError: PNG depiction support not found. You should compile Open
Babel with support for Cairo. See installation instructions for more
information.
libpng 1.6.28 vc9_0 [vc9] conda-forge
pillow 4.0.0 py27_0
pycairo 1.10.0 <pip>
openbabel 2.4.1 py27_2 openbabel
cairo 1.14.6 vc9_4 [vc9] conda-forge
I have both pillow and (py)cairo. Why can't I draw the molecule ?
I guess that if I followed the suggestion and compile it with suport cairo
it will work. But I have to work with conda. Is there any better way?
Sincerely,
________________________________
Hongbin Yang 杨弘宾
Research: Toxicophore and Chemoinformatics
Pharmaceutical Science, School of Pharmacy
East China University of Science and Technology
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Maciek Wójcikowski
2017-05-31 13:00:02 UTC
Permalink
I've rebuilt the Python 2.7 packages for Windows (the rest is still
compiling), and the PNG should work now. Update openbabel package to 2.4.1
py27_3: `conda install -c openbabel openbabel`.

----
Pozdrawiam, | Best regards,
Maciek Wójcikowski
Post by Noel O'Boyle
That's a pity. In the meanwhile, you can still create SVG images if
you choose this a write format, and pysvg might be able to convert to
PNG (?).
Post by Maciek Wójcikowski
Hi,
PNG is not supported yet on Windows - Openbabel was not compiled with
it, as
Post by Maciek Wójcikowski
there is no cairo package on Anaconda main channel for windows (note
you're
Post by Maciek Wójcikowski
using conda-forge).
Unfortunately this is also the case in bioconda, so for now there is no
better conda solution yet. I will revisit this issue and try to support
PNG
Post by Maciek Wójcikowski
files.
----
Pozdrawiam, | Best regards,
Maciek Wójcikowski
Post by Hongbin Yang
Hi
I installed openbabel via `conda install -c openbabel openbabel`.
I wanted to draw the molecule like
`pybel.readstring('smi','c1ccccc1').draw()`
C:\Users\yanya\Anaconda2\lib\site-packages\pybel.pyc in draw(self,
show,
Post by Maciek Wójcikowski
Post by Hongbin Yang
filename, update, usecoords)
615 formatok = obconversion.SetOutFormat("_png2")
--> 617 raise ImportError("PNG depiction support not found. You should "
618 "compile Open Babel with support for Cairo. See "
619 "installation instructions for more "
ImportError: PNG depiction support not found. You should compile Open
Babel with support for Cairo. See installation instructions for more
information.
libpng 1.6.28 vc9_0 [vc9] conda-forge
pillow 4.0.0 py27_0
pycairo 1.10.0 <pip>
openbabel 2.4.1 py27_2 openbabel
cairo 1.14.6 vc9_4 [vc9] conda-forge
I have both pillow and (py)cairo. Why can't I draw the molecule ?
I guess that if I followed the suggestion and compile it with suport
cairo
Post by Maciek Wójcikowski
Post by Hongbin Yang
it will work. But I have to work with conda. Is there any better way?
Sincerely,
________________________________
Hongbin Yang 杚匘実
Research: Toxicophore and Chemoinformatics
Pharmaceutical Science, School of Pharmacy
East China University of Science and Technology
------------------------------------------------------------
------------------
Post by Maciek Wójcikowski
Post by Hongbin Yang
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
------------------------------------------------------------
------------------
Post by Maciek Wójcikowski
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Loading...