Closed ghost closed 6 years ago
It's likely that openbabel was not properly installed. How'd you install the program?
Hi Patrick, I used:
import sys
!{sys.executable} -m pip install pybel
in jupyter.
That's the issue. The pip pybel package doesn't install the openbabel library, so most of pybel won't work.
Your two options are to install from source or, if you use conda, try conda install -c openbabel openbabel
(works 80% of the time).
Hi Patrick, thanks for your help, I was able to get it working using the conda install
method.
I am trying to use another package which also require openbabel and pybel.
Reinstalling using conda install -c openbabel openbabel
did not help.
I am getting the same error message
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-b8e3e949172b> in <module>
2
3 my_mol = PDBComplex()
----> 4 my_mol.load_pdb("C:\\Users\username\Documents\HD\MEP\IspC_DXR\PfDXR_3D\\5jaz.pdb") # Load the PDB file into PLIP class
5 print(my_mol) # Shows name of structure and ligand binding sites
6 my_bsid = 'E20:A:2001' # Unique binding site identifier (HetID:Chain:Position)
~\Anaconda3\envs\base-copy\lib\site-packages\plip\modules\preparation.py in load_pdb(self, pdbpath, as_string)
1316 if not as_string:
1317 self.sourcefiles['filename'] = os.path.basename(self.sourcefiles['pdbcomplex'])
-> 1318 self.protcomplex, self.filetype = read_pdb(self.corrected_pdb, as_string=True)
1319
1320 # Update the model in the Mapper class instance
~\Anaconda3\envs\base-copy\lib\site-packages\plip\modules\supplemental.py in read_pdb(pdbfname, as_string)
383 def read_pdb(pdbfname, as_string=False):
384 """Reads a given PDB file and returns a Pybel Molecule."""
--> 385 pybel.ob.obErrorLog.StopLogging() # Suppress all OpenBabel warnings
386 if os.name != 'nt': # Resource module not available for Windows
387 maxsize = resource.getrlimit(resource.RLIMIT_STACK)[-1]
@patrickfuller, other suggestion to this problem?
@diallobakary4 you should ask over at openbabel/openbabel.
Ok. Thank you.
Le ven. 11 janv. 2019 à 20:26, Patrick Fuller notifications@github.com a écrit :
@diallobakary4 https://github.com/diallobakary4 you should ask over at openbabel/openbabel https://github.com/openbabel/openbabel.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/patrickfuller/imolecule/issues/33#issuecomment-453611581, or mute the thread https://github.com/notifications/unsubscribe-auth/AM6CFaXmF9O9gqTzrZA6MHejh1oJ6_7Jks5vCNdogaJpZM4T2zfg .
--
Bakary N’tji DIALLO
PhD Student (Bioinformatics) http://linkedin.com/in/bakarydiallo, Research Unit in Bioinformatics (RUBi) https://rubi.ru.ac.za/
Mail: diallobakary4@gmail.com | Skype: diallobakary4
Tel: +27798233845 | +223 74 56 57 22 | +223 97 39 77 14
I've got into the same situation and simply added one more except after this line: https://github.com/patrickfuller/imolecule/blob/8e143f21928cec54d346ccd259ef4b9289da1700/imolecule/format_converter.py#L18 Since I'm using openbabel > 3 - this check is really not configured well and it fails not at import error - but at attribute error - so one more except is needed to handle this case.
...
except ImportError:
has_ob = False
except:
has_ob = False
@thoth291 I just took a pass at making the code support only open babel 3. Try pip install -U imolecule
and let me know if it works for you.
I'll also update the code base to asyncio / python 3 / ES6 when I get the time. Hope this helps!
Thank you, @patrickfuller , it works (in terms of importing properly). I also noticed that it doesn't work in Jupyter Lab - I made a reference about it here: #32
@thoth291 that's unfortunately a harder problem and would take some work to do right. I'd recommend using a better maintained chemical drawer like 3DMol.js if it suits your needs.
Sorry I can't help more!
@patrickfuller , yep, that's what I ended up to be using so far. Sort of a mixture of rdkit and py3dmol... Thank you for your help!
While attempting to draw() a smile, I get this error message:
`AttributeError Traceback (most recent call last)