openbabel / openbabel

Open Babel is a chemical toolbox designed to speak the many languages of chemical data.
http://openbabel.org/
GNU General Public License v2.0
1.08k stars 414 forks source link

Attribute error: readstring in the module pybel.py #1543

Closed pearlphilip closed 7 years ago

pearlphilip commented 7 years ago

I believe this to be a bug with openbabel/openbabel/scripts/python/pybel.py in line 172 for function readstring

Expected Behavior

Example:

input = "C1=CC=CS1"
mymol = readstring("smi", input)
len(mymol.atoms)

5

Actual Behavior

I get this error

pip install pybel
...
import pybel

mol = pybel.readstring("smi", smiles)
AttributeError: 'module' object has no attribute 'readstring'
baoilleach commented 7 years ago

What operating system and version is this? Can you search your computer for other files with the name pybel.py?

mcs07 commented 7 years ago

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

baoilleach commented 7 years ago

Ah - of course - the penny drops. Thanks Matt.

On 24 February 2017 at 09:31, Matt Swain notifications@github.com wrote:

pip install pybel is not correct. That's an unrelated package https://pypi.python.org/pypi/PyBEL. Instead, do pip install openbabel

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/openbabel/openbabel/issues/1543#issuecomment-282246095, or mute the thread https://github.com/notifications/unsubscribe-auth/AACxGZgnua6V7xZVzFXy_T9_1qfIr6xEks5rfqNZgaJpZM4MK3ru .