Re: [Open Babel] Using pybel.readstring() and using pybel in Python 2.7

2017-03-09 Thread Quim Aguirre
Thank you David!

I have also tried installing openbabel, but I get the following error:

$> pip install openbabel

Collecting openbabel
  Downloading openbabel-2.4.1.tar.gz (74kB)
100% || 81kB 1.1MB/s
Installing collected packages: openbabel
  Running setup.py install for openbabel ... error
Complete output from command /usr/bin/python -u -c "import setuptools,
tokenize;__file__='/private/tmp/pip-build-7qwutX/openbabel/setup.py';f=getattr(tokenize,
'open', open)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record
/tmp/pip-q5ZfA0-record/install-record.txt
--single-version-externally-managed --compile:
running install
running build_ext
Open Babel location automatically determined by pkg-config:
- include_dirs:
['/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7',
'/usr/local/Cellar/open-babel/2.4.0/include/openbabel-2.0']
- library_dirs: ['/usr/local/Cellar/open-babel/2.4.0/lib']
building '_openbabel' extension
swigging openbabel-python.i to openbabel-python_wrap.cpp
swig -python -c++ -small -O -templatereduce -naturalvar
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-I/usr/local/Cellar/open-babel/2.4.0/include/openbabel-2.0 -o
openbabel-python_wrap.cpp openbabel-python.i
unable to execute 'swig': No such file or directory

Error: SWIG failed. Is Open Babel installed?
You may need to manually specify the location of Open Babel include and
library directories. For example:
  python setup.py build_ext -I/usr/local/include/openbabel-2.0
-L/usr/local/lib
  python setup.py install



Do you know why is this error occurring?

Thank you very much for your help,

Quim

2017-03-09 15:29 GMT+01:00 David Hall :

> Quoting from Matt Swain a couple weeks ago:
>
> pip install pybel is not correct. That's an unrelated package
> . Instead, do pip install openbabel
>
>
>
> -David
>
> On Mar 9, 2017, at 8:29 AM, Quim Aguirre  wrote:
>
> Hello,
>
> I am new at using Open Babel software. My intention is to use "Pybel" to
> calculate structural similarity.
>
> First, I have installed Pybel for Python 3 this way:
>
> $> pip3 install pybel
>
> However, I cannot use the function "readstring":
>
> $> python3
> >>> import pybel
> >>> smiles = ['', 'CCCN']
> >>> mols = [pybel.readstring("smi", x) for x in smiles] # Create a list of
> two molecules
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "", line 1, in 
> AttributeError: module 'pybel' has no attribute 'readstring'
>
> Do you know why is this happening?
>
> The other problem is that I am interested in using Pybel in Python 2.7.
> However, I cannot successfully run it. I install it properly this way:
>
> $> pip install pybel
>
> But then, when importing it, I get the following error:
>
> $> python
> >>> import pybel
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/Library/Python/2.7/site-packages/pybel/__init__.py", line 54, in
> 
> from . import io
>   File "/Library/Python/2.7/site-packages/pybel/io.py", line 31, in
> 
> from .canonicalize import decanonicalize_node
>   File "/Library/Python/2.7/site-packages/pybel/canonicalize.py", line 9,
> in 
> from .parser.language import rev_abundance_labels
>   File "/Library/Python/2.7/site-packages/pybel/parser/__init__.py", line
> 8, in 
> from .parse_bel import BelParser
>   File "/Library/Python/2.7/site-packages/pybel/parser/parse_bel.py",
> line 15, in 
> from .baseparser import BaseParser, WCW, nest, one_of_tags, triple
>   File "/Library/Python/2.7/site-packages/pybel/parser/baseparser.py",
> line 22, in 
> quote = dblQuotedString().setParseAction(removeQuotes)
> TypeError: __call__() takes exactly 2 arguments (1 given)
>
> Do you know what could be the reason of these errors? It would be very
> interesting for me to be able to use this package.
>
> Thank you very much,
>
> Quim
>
> --
>
> *Joaquim Aguirre Plans*
> Researcher in the Structural Bioinformatics Laboratory (DCEXS-UPF)
> Student of the MSc Bioinformatics for Health Sciences (UPF/UB)
> Graduate in Biotechnology (UAB), specialization in Biotechnology of
> Processes
> [Tel.] +34 692 352 112 <+34%20692%2035%2021%2012>
> quim.agui...@gmail.com
> joaquim.agui...@upf.edu
>
> 
> --
> Announcing the Oxford Dictionaries API! The API offers world-renowned
> dictionary content that is easy and intuitive to access. Sign up for an
> account today to start using our lexical data to power your apps and
> projects. Get started today and enter our developer competition.
> http://sdm.link/oxford
>
> ___
> OpenBabel-discuss mailing list
> 

Re: [Open Babel] Using pybel.readstring() and using pybel in Python 2.7

2017-03-09 Thread David Hall
Quoting from Matt Swain a couple weeks ago:

> pip install pybel is not correct. That's an unrelated package. Instead, do 
> pip install openbabel


-David

> On Mar 9, 2017, at 8:29 AM, Quim Aguirre  wrote:
> 
> Hello,
> 
> I am new at using Open Babel software. My intention is to use "Pybel" to 
> calculate structural similarity. 
> 
> First, I have installed Pybel for Python 3 this way:
> 
> $> pip3 install pybel
> 
> However, I cannot use the function "readstring":
> 
> $> python3
> >>> import pybel
> >>> smiles = ['', 'CCCN']
> >>> mols = [pybel.readstring("smi", x) for x in smiles] # Create a list of 
> >>> two molecules
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "", line 1, in 
> AttributeError: module 'pybel' has no attribute 'readstring'
> 
> Do you know why is this happening?
> 
> The other problem is that I am interested in using Pybel in Python 2.7. 
> However, I cannot successfully run it. I install it properly this way:
> 
> $> pip install pybel
> 
> But then, when importing it, I get the following error:
> 
> $> python
> >>> import pybel
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/Library/Python/2.7/site-packages/pybel/__init__.py", line 54, in 
> 
> from . import io
>   File "/Library/Python/2.7/site-packages/pybel/io.py", line 31, in 
> from .canonicalize import decanonicalize_node
>   File "/Library/Python/2.7/site-packages/pybel/canonicalize.py", line 9, in 
> 
> from .parser.language import rev_abundance_labels
>   File "/Library/Python/2.7/site-packages/pybel/parser/__init__.py", line 8, 
> in 
> from .parse_bel import BelParser
>   File "/Library/Python/2.7/site-packages/pybel/parser/parse_bel.py", line 
> 15, in 
> from .baseparser import BaseParser, WCW, nest, one_of_tags, triple
>   File "/Library/Python/2.7/site-packages/pybel/parser/baseparser.py", line 
> 22, in 
> quote = dblQuotedString().setParseAction(removeQuotes)
> TypeError: __call__() takes exactly 2 arguments (1 given)
> 
> Do you know what could be the reason of these errors? It would be very 
> interesting for me to be able to use this package.
> 
> Thank you very much,
> 
> Quim
> 
> -- 
> Joaquim Aguirre Plans
> Researcher in the Structural Bioinformatics Laboratory (DCEXS-UPF)
> Student of the MSc Bioinformatics for Health Sciences (UPF/UB)
> Graduate in Biotechnology (UAB), specialization in Biotechnology of Processes
> [Tel.] +34 692 352 112
> quim.agui...@gmail.com
> joaquim.agui...@upf.edu
> 
> --
> Announcing the Oxford Dictionaries API! The API offers world-renowned
> dictionary content that is easy and intuitive to access. Sign up for an
> account today to start using our lexical data to power your apps and
> projects. Get started today and enter our developer competition.
> http://sdm.link/oxford
> ___
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


[Open Babel] Using pybel.readstring() and using pybel in Python 2.7

2017-03-09 Thread Quim Aguirre
Hello,

I am new at using Open Babel software. My intention is to use "Pybel" to
calculate structural similarity.

First, I have installed Pybel for Python 3 this way:

$> pip3 install pybel

However, I cannot use the function "readstring":

$> python3
>>> import pybel
>>> smiles = ['', 'CCCN']
>>> mols = [pybel.readstring("smi", x) for x in smiles] # Create a list of
two molecules
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in 
AttributeError: module 'pybel' has no attribute 'readstring'

Do you know why is this happening?

The other problem is that I am interested in using Pybel in Python 2.7.
However, I cannot successfully run it. I install it properly this way:

$> pip install pybel

But then, when importing it, I get the following error:

$> python
>>> import pybel
Traceback (most recent call last):
  File "", line 1, in 
  File "/Library/Python/2.7/site-packages/pybel/__init__.py", line 54, in

from . import io
  File "/Library/Python/2.7/site-packages/pybel/io.py", line 31, in 
from .canonicalize import decanonicalize_node
  File "/Library/Python/2.7/site-packages/pybel/canonicalize.py", line 9,
in 
from .parser.language import rev_abundance_labels
  File "/Library/Python/2.7/site-packages/pybel/parser/__init__.py", line
8, in 
from .parse_bel import BelParser
  File "/Library/Python/2.7/site-packages/pybel/parser/parse_bel.py", line
15, in 
from .baseparser import BaseParser, WCW, nest, one_of_tags, triple
  File "/Library/Python/2.7/site-packages/pybel/parser/baseparser.py", line
22, in 
quote = dblQuotedString().setParseAction(removeQuotes)
TypeError: __call__() takes exactly 2 arguments (1 given)

Do you know what could be the reason of these errors? It would be very
interesting for me to be able to use this package.

Thank you very much,

Quim

-- 

*Joaquim Aguirre Plans*
Researcher in the Structural Bioinformatics Laboratory (DCEXS-UPF)
Student of the MSc Bioinformatics for Health Sciences (UPF/UB)
Graduate in Biotechnology (UAB), specialization in Biotechnology of
Processes
[Tel.] +34 692 352 112
quim.agui...@gmail.com
joaquim.agui...@upf.edu
--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss