Hi Navid,

the Descriptors module is not auto-imported when Chem is imported.

So the first example will work if you do:

from rdkit import Chem
import rdkit.Chem.Descriptors
Chem.Descriptors.MolWt(Chem.MolFromSmiles('CC'))

Cheers,
p.

On 23/01/2020 17:26, Navid Shervani-Tabar wrote:
Thanks, Paolo! That worked! But let me get this straight, if I use

from rdkit import Chem
Chem.Descriptors.MolWt(Chem.MolFromSmiles('CC'))

it does not work, but when I do

from rdkit import Chem
from rdkit.Chem import Descriptors
Descriptors.MolWt(Chem.MolFromSmiles('CC'))

it works. Shouldn't these be the same?

Thanks,
Navid


On Thu, Jan 23, 2020 at 12:07 PM Paolo Tosco <paolo.tosco.m...@gmail.com <mailto:paolo.tosco.m...@gmail.com>> wrote:

    Hi Navid,

    try adding

    import rdkit.Chem.Descriptors

    before attempting to use MolWt.

    Cheers,
    p.

    On 23/01/2020 17:02, Navid Shervani-Tabar wrote:
    Update: I was able to go back to square one. Using
    RDKit-2019.09.3.0 I still get the error

    module 'rdkit.Chem' has no attribute 'Descriptors'

    when using Chem.Descriptors.MolWt.

    Navid



    On Thu, Jan 23, 2020 at 9:37 AM Navid Shervani-Tabar
    <nshe...@gmail.com <mailto:nshe...@gmail.com>> wrote:

        Hello,

        I was trying to use the MolWt function in RDKit. I tried
        Chem.Descriptors.MolWt but I got

        module 'rdkit.Chem' has no attribute 'Descriptors'

        I thought that might be related to the fact that I used the
        2019.03 version. So I updated using

        conda install -c conda-forge rdkit

        But now when I import

        from rdkit.Chem.QED import qed

        I get

        Process finished with exit code 139 (interrupted by signal
        11: SIGSEGV)

        Any suggestions how to fix this?

        Thanks!
        Navid




    _______________________________________________
    Rdkit-discuss mailing list
    Rdkit-discuss@lists.sourceforge.net  
<mailto:Rdkit-discuss@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to