Code Monkey home page Code Monkey logo

django-rdkit's Introduction

RDKit

Azure build Status Documentation Status DOI

RDKit is a collection of cheminformatics and machine-learning software written in C++ and Python.

  • BSD license - a business friendly license for open source
  • Core data structures and algorithms in C++
  • Python 3.x wrapper generated using Boost.Python
  • Java and C# wrappers generated with SWIG
  • 2D and 3D molecular operations
  • Descriptor and Fingerprint generation for machine learning
  • Molecular database cartridge for PostgreSQL supporting substructure and similarity searches as well as many descriptor calculators
  • Cheminformatics nodes for KNIME
  • Contrib folder with useful community-contributed software harnessing the power of the RDKit

Community

Code

Web presence

Materials from user group meetings

Documentation

Available on the RDKit page and in the Docs folder on GitHub

Installation

Installation instructions are available in Docs/Book/Install.md.

Binary distributions, anaconda, homebrew

  • binaries for conda python or, if you are using the conda-forge stack, the RDKit is also available from conda-forge.
  • RPMs for RedHat Enterprise Linux, Centos, and Fedora. Contributed by Gianluca Sforna.
  • debs for Ubuntu and other Debian-derived Linux distros. Contributed by the Debichem team.
  • homebrew formula for building on the Mac. Contributed by Eddie Cao.
  • recipes for building using the excellent conda package manager. Contributed by Riccardo Vianello.
  • APKs for Alpine Linux. Contributed by da Verona
  • Wheels at PyPi for all major platforms and python versions. Contributed by Christopher Kuenneth

Projects using RDKit

  • ROBERT - Automated Machine Learning Protocols
  • AQME - Automated Quantum Mechanical Environment
  • chemprop - message passing neural networks for molecular property prediction
  • RMG - Reaction Mechanism Generator
  • RDMC - Reaction Data and Molecular Conformers - package for dealing with reactions, molecules, conformers, mainly in 3D
  • pychemprojections - python library for visualizing various 2D projections of molecules.
  • pychemovality - python library for estimating the ovality of molecules.
  • ChEMBL Structure Pipeline - ChEMBL protocols used to standardise and salt strip molecules.
  • FPSim2 - Simple package for fast molecular similarity searches.
  • Datamol (docs, repo) - A Python library to intuitively manipulate molecules.
  • Scopy (docs, paper) - an integrated negative design Python library for desirable HTS/VS database design
  • stk (docs, paper) - a Python library for building, manipulating, analyzing and automatic design of molecules.
  • gpusimilarity - A Cuda/Thrust implementation of fingerprint similarity searching
  • Samson Connect - Software for adaptive modeling and simulation of nanosystems
  • mol_frame - Chemical Structure Handling for Dask and Pandas DataFrames
  • RDKit.js - The official JavaScript release of RDKit
  • DeepChem - python library for deep learning for chemistry
  • mmpdb - Matched molecular pair database generation and analysis
  • CheTo (paper)- Chemical topic modeling
  • OCEAN (paper)- Optimized cross reactivity estimation
  • ChEMBL Beaker - standalone web server wrapper for RDKit and OSRA
  • ZINC - Free database of commercially-available compounds for virtual screening
  • sdf_viewer.py - an interactive SDF viewer
  • sdf2ppt - Reads an SDFile and displays molecules as image grid in powerpoint/openoffice presentation.
  • MolGears - A cheminformatics tool for bioactive molecules
  • PYPL - Simple cartridge that lets you call Python scripts from Oracle PL/SQL.
  • shape-it-rdkit - Gaussian molecular overlap code shape-it (from silicos it) ported to RDKit backend
  • WONKA - Tool for analysis and interrogation of protein-ligand crystal structures
  • OOMMPPAA - Tool for directed synthesis and data analysis based on protein-ligand crystal structures
  • OCEAN - web-tool for target-prediction of chemical structures which uses ChEMBL as datasource
  • chemfp - very fast fingerprint searching
  • rdkit_ipynb_tools - RDKit Tools for the IPython Notebook
  • Vernalis KNIME nodes
  • Erlwood KNIME nodes
  • AZOrange

License

Code released under the BSD license.

django-rdkit's People

Contributors

adam-of-barot avatar benjymack avatar michelml avatar paconius avatar rustamzh avatar rvianello avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-rdkit's Issues

Where to set do_chiral_sss?

Hi again.

I want to ensure that the chiral_sss is set for my app. I tried to implement this by adding the code below to my app.py Config class (which gets run once at startup).

from django_rdkit.config import config
config.do_chiral_sss = True

However, this gives an error, likely due to the connection not being correctly setup at the time the function is called.

django.db.utils.ProgrammingError: unrecognized configuration parameter "rdkit.do_chiral_sss"

If I stick this code in some other function which is called after all initialization is complete (like a clean function for my model) it works fine.

My question then is, in your experience, where is the best place to put this code snippet so it is run once, early on?

Django Gist Index

Is there any difference between using django-rdkit GiSTOperation manually writing migration and using GiST Index from Django ORM.

From quick scan of generated SQL, it looks the same.

Issue with migrate

Hi all,

I am trying to build a REST API around an existing command line tool I had which is connected to a postgres db using rdkit cartridge. I am trying to use django for building the server around the app and using the existing DB.

After setting up the project, the app etc. and configuring settings.py to use the existing db, I run an inspectdb with good results. I copied the output to models.py file with the suggested models. I replaced the generic types suggested by django by the models provided in django-rdkit (I have some Mol and BFP columns). When I finally call the manage.py migrate, I get the following error:

what am I doing wrong?? I'd really appreaciate your help!

`Running migrations:
Applying chemspace_server.0001_initial... OK
Applying django_rdkit.0001_setup...Traceback (most recent call last):
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/db/backends/utils.py", line 82, in _execute
return self.cursor.execute(sql)
psycopg2.errors.UndefinedObject: type "mol" does not exist
LINE 1: SELECT mol_to_smiles('C'::mol)
^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 22, in
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/core/management/init.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/core/management/base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/core/management/base.py", line 371, in execute
output = self.handle(*args, **options)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/core/management/base.py", line 85, in wrapped
res = handle_func(*args, **kwargs)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/core/management/commands/migrate.py", line 245, in handle
fake_initial=fake_initial,
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/db/migrations/executor.py", line 117, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/db/migrations/executor.py", line 227, in apply_migration
state = migration.apply(state, schema_editor)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/db/migrations/migration.py", line 124, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django_rdkit/operations.py", line 16, in database_forwards
c.execute("SELECT mol_to_smiles('C'::mol)")
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/db/backends/utils.py", line 98, in execute
return super().execute(sql, params)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/db/utils.py", line 90, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/dalvarez/miniconda3/envs/chemspace/lib/python3.7/site-packages/django/db/backends/utils.py", line 82, in _execute
return self.cursor.execute(sql)
django.db.utils.ProgrammingError: type "mol" does not exist
LINE 1: SELECT mol_to_smiles('C'::mol)`

Error preventing to move to django 4 (ugettext_lazy no longer supported)

app_1            |   File "/opt/conda/envs/app_env/lib/python3.9/site-packages/django_rdkit/models/fields.py", line 2, in <module>
app_1            |     from django.utils.translation import ugettext_lazy as _
app_1            | ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/opt/conda/envs/app_env/lib/python3.9/site-packages/django/utils/translation/__init__.py)

ugettext_lazy simply needs to be change to gettext_lazy

I'll make a PR for it

Unable to set cartridge parameters through django_rdkit.config

Hi,
I am unable to set any cartridge parameters like do_chiral_sss or tanimoto_threshold programmatically
as shown in the tutorial here: https://github.com/rdkit/django-rdkit/blob/master/docs/tutorial.rst

Using do_chiral_sss as an example:

import django
#  django setup part ommited here...
from django.db import connection
from importlib.metadata import version
from django.db import connection as conn
import django_rdkit
from django_rdkit.config import config as rdk_config
from tkdb.models import Compound

print("Django:", django.VERSION)
print("PostgreSQL:", connection.cursor().connection.server_version)
print("Django-RDKit:", version("django_rdkit"))
print("Connection id:", id(connection))

rdk_config.do_chiral_sss = False
print("Chiral:", rdk_config.do_chiral_sss)
print("Hits:", Compound.objects.filter(molecule__hassubstruct="NC(=O)[C@H]1CCCN1C=O").count())
rdk_config.do_chiral_sss = True
print("Chiral:", rdk_config.do_chiral_sss)
print("Hits:", Compound.objects.filter(molecule__hassubstruct="NC(=O)[C@H]1CCCN1C=O").count())

print("Connection id:", id(connection))

Output: (same number of hits with different do_chiral_sss setting which is wrong. the connection remains the same between queries)

Django: (3, 2, 11, 'final', 0)
PostgreSQL: 130002
Django-RDKit: 0.3.1
Connection id: 140698524695232
Chiral: false
Hits: 5045
Chiral: true
Hits: 5045
Connection id: 140698524695232

Output from postgresql server log file: (the parameter is actually set)

# 2022-04-25 15:38:45 CEST LOG:  statement: SET rdkit.do_chiral_sss=false
# 2022-04-25 15:38:45 CEST LOG:  statement: SELECT COUNT(*) AS "__count" FROM "tkdb_compound" WHERE "tkdb_compound"."molecule" @> mol_from_pkl('\xefbeadde000000000c00000001000000000000000a0000000a000000800107006800000003010206002800000003040800280000000302062034000000010104060060000000020206006000000002020600600000000202070028000000030306006800000003030108002800000003020b00012001022802010300030400040500050600060700070820080928020703001401050304050607170000000016'::bytea)
# 2022-04-25 15:38:45 CEST LOG:  statement: SET rdkit.do_chiral_sss=true
# 2022-04-25 15:38:45 CEST LOG:  statement: SELECT COUNT(*) AS "__count" FROM "tkdb_compound" WHERE "tkdb_compound"."molecule" @> mol_from_pkl('\xefbeadde000000000c00000001000000000000000a0000000a000000800107006800000003010206002800000003040800280000000302062034000000010104060060000000020206006000000002020600600000000202070028000000030306006800000003030108002800000003020b00012001022802010300030400040500050600060700070820080928020703001401050304050607170000000016'::bytea)

Pasting statements directly into psql works fine: (manually setting the parameter to false/true results in different number of hits)

db=> SET rdkit.do_chiral_sss=false;
SET

db=> SELECT COUNT(*) AS "__count" FROM "tkdb_compound" WHERE "tkdb_compound"."molecule" @> mol_from_pkl('\xefbeadde000000000c00000001000000000000000a0000000a000000800107006800000003010206002800000003040800280000000302062034000000010104060060000000020206006000000002020600600000000202070028000000030306006800000003030108002800000003020b00012001022802010300030400040500050600060700070820080928020703001401050304050607170000000016'::bytea);
 __count
---------
    5045

db=> SET rdkit.do_chiral_sss=true;
SET

db=> SELECT COUNT(*) AS "__count" FROM "tkdb_compound" WHERE "tkdb_compound"."molecule" @> mol_from_pkl('\xefbeadde000000000c00000001000000000000000a0000000a000000800107006800000003010206002800000003040800280000000302062034000000010104060060000000020206006000000002020600600000000202070028000000030306006800000003030108002800000003020b00012001022802010300030400040500050600060700070820080928020703001401050304050607170000000016'::bytea);
 __count
---------
    1051

I also tried modifying CONN_MAX_AGE in settings.py, with no result.

Any idea what I am doing wrong?

thanks in advance

MolField hassubstruct perfomance for complex molecules

Hello! Sorry for the possibly off topic question and my English) But maybe django-rdkit community help me with my trouble

I am using django-rdkit for store mol objects. In my database I have 10 millions molecules. I am having trouble with this amount of data when try to select molecules which is substructure of target molecule if target molecule is complex.

For example if I need select molecules when hassubstruct= c1ccccc1 its work fast. But when I try to select molecules with hassubstruct= COc1cccnc1C1=CCN(C(=O)OC(C)(C)C)CC1 I am gave very slow query.

Maybe someone have same troubles and have recommendations how to up performance.

And next one questions is which algoritm rdkit catridge use for this (hassubstruct (@>)) operation. Maybe someone know any articls about this, or can explain. I'm asking because I think there might be ways to optimize search speed with data mining. For example, I do not use exact lookup to accurately search for a molecule, but instead I store smiles in a separate field in the same model and search for them. Perhaps it will also be possible to simplify the search for substructures.

Issue with Django 3

Hello guys,

This import doesn't work anymore in Django 3:

from django.utils import six

Indeed, it has been deprecated: https://docs.djangoproject.com/en/3.0/releases/3.0/#removed-private-python-2-compatibility-apis

I have done a simple change on my fork that makes it work: roukydesbois@02ed8e2

But I'm pretty sure it won't work with previous versions of Django. So I'm not sure how to properly handle this ๐Ÿ˜„

Thanks!

Exact structure searches

I note that rdkit-django performs two substructure searches instead of an equals search when implementing the django "exact" operator. For the sake of overall performance it would seem to be beneficial to perform a simple exact query rather than two substructure queries. Looking at the code, the exact search appears to be commented out of the function SameStructure [models.py -- snip below] and replaced with the two substructure alternative. Any rememberances as to why this is implemented this way?

class SameStructure(Lookup):
...
#return '%s @= %s' % (lhs, rhs), params
return '%s <@ %s AND %s @> %s' % (lhs, rhs, lhs, rhs), params + params

problem generating molecule from blob data

I'm following the tutorial, but when I try to add a new compound using
Compound.objects.create(name='benzene', molecule='c1ccccc1') I got the following error:

django.db.utils.DataError
django.db.utils.DataError: problem generating molecule from blob data

my requirements.txt file has:

# RDKIT
rdkit-pypi==2021.9.4
-e git+https://github.com/rdkit/[email protected]#egg=django_rdkit

while my models.py file is:

from django_rdkit import models

class Compound(models.Model):
    name = models.CharField(max_length=500)
    structure = models.MolField(verbose_name="Structure")

RDKit 2021.09 compatibility

Upon updating to RDKit 2021.09.02 from 2021.03.05 I can no longer perform structure based lookups.
I tried performing .filter() queries both from the frontend and the backend, but both resulted in the same error.
The cartridge itself still works, as I was able to do smiles based raw SQL queries.

Django gives the following error:
"DataError: problem generating molecule from blob data"

The top level traceback:

~/venv/lib/python3.8/site-packages/django/db/backends/utils.py, line 85, in _execute
78    def _execute(self, sql, params, *ignored_wrapper_args):
79        self.db.validate_no_broken_transaction()
80        with self.db.wrap_database_errors:
81            if params is None:
82                # params default might be backend specific.
83                return self.cursor.execute(sql)
84            else:
85                return self.cursor.execute(sql, params)

For the time being I reverted back to RDKit 2021.03.05.

Using mol_adjust_query_properties()

I recently needed to do substructure queries that take into account explicit hydrogens. I found out that the mol_adjust_query_properties() cartridge function does what I want.

I gathered that there is no built-in way to access that feature through field lookups.
I managed to do it by creating a new Lookup and registering it to MolField.

Is there be a cleaner way to do this? My solution also doesn't support additional parameters unfortunately.

Unique molfield error

I've been playing around with rdkit-django for a bit and think I've come across an issue which could use some documentation in the docs.

I observe that if you specify a MolField to be unique, the django code to check for uniqueness will raise an exception.

class Compound(models.Model):
    molecule = models.MolField(unique=True)

This isn't an issue if you create new objects directly by using Compound.objects.create() (as in the tutorial). But it is a problem if you use the Django admin web interface to create new entries. The error occurs during the full_clean() of the input data. This makes a call to self._perform_unique_checks(...) in the base model, which issues a SQL query to check uniqueness. This causes the error below. It appears that the DB is choking on the comparison of two mol objects.
My first thought is to somehow override this behavior so that cxSMILES strings are compared instead; but I'm not advanced enough at this point to pull this off. Since uniqueness is such a basic concept, I'm guessing that this has been solved numerous times before. Adding the solution to the tutorial/docs would be great!

Thanks.

Django Version: 2.1.1
ProgrammingError can't adapt type 'Mol'
...lib/python3.6/site-packages/django/db/backends/utils.py in _execute, line 85
Python Version: 3.6.5
rdkit Version: '2018.03.4'
params (<rdkit.Chem.rdchem.Mol object at 0x11576b8a0>, <rdkit.Chem.rdchem.Mol object at 0x11576b8a0>)
self <django.db.backends.utils.CursorDebugWrapper object at 0x1157f0f28>
sql ('SELECT (1) AS "a" FROM "myapp_compound" WHERE "myapp_compound"."molecule" <@ %s ' 'AND "myapp_compound"."molecule" @> %s LIMIT 1')

Release as package on PyPI

Hi, would you be interested in packaging this for release on the Python Package Index? I would be willing to lend a hand in making this easy through use of GitHub Actions.

Edit: Just saw #9 ๐Ÿ˜ณ Please feel free to close in favor of that but my offer to submit a PR implementing this stands.

Migrations with Fingerprint Fields

I recently tried to add a fingerprint field to a model and then perform a migration. Following the documentation, which suggests

class django_rdkit.models.BfpField(**options)
A bit vector fingerprint. It may be assigned using an ExplicitBitVect instance or with an update query using one of the implemented fingerprint functions.

I attempted to set a default using an instance of ExplicitBitVect like so:

class Compound(models.Model):
    [...]
    morganbv_fp = models.BfpField(default=ExplicitBitVect(1))

to which Django's makemigrations complains that ExplicitBitVect is unserializable. Since it is initializable with an unsigned integer which Django can serialize just fine, I derived the class and decorated it (see Django Docs Migration Serializing):

from django.utils.deconstruct import deconstructible

[...]

@deconstructible
class DeconExplicitBitVect(ExplicitBitVect):
    pass

[...]

class Compound(models.Model):
    [...]
    morganbv_fp = models.BfpField(default=DeconExplicitBitVect(1))

This allows the class to be serialized and makemigrations passes, but migrate fails due to:

django.db.utils.ProgrammingError: column "morganbv_fp" is of type bfp but default expression is of type bytea

The SQL expression generated by makemigrations is:

BEGIN;
--
-- Add field morganbv_fp to compound
--
ALTER TABLE "rest_compound" ADD COLUMN "morganbv_fp" bfp DEFAULT '\000'::bytea NOT NULL;
ALTER TABLE "rest_compound" ALTER COLUMN "morganbv_fp" DROP DEFAULT;

COMMIT;

Which is of course nonsense. Now I don't know where exactly this would be corrected, but I suspect it's due to models/fields.py:

[...]
class BfpField(Field):
    [...]
    def get_prep_value(self, value):
        # convert the ExplicitBitVect instance to the value used by the 
        # db driver
        if isinstance(value, ExplicitBitVect):
            value = six.memoryview(DataStructs.BitVectToBinaryText(value))
        return value
    [...]

I fixed it by just setting the field to be nullable and the default null. It doesn't really matter whether I fill it with a nonsensical sfp instance or just allow it to be null in practice to me.

Is there a better way I completely missed? Otherwise I would recommend adapting the documentation to suggest allowing the fingerprint fields to be null in order for migrations to work.

Cheers and thanks for your time!

Using Mol Field

Hello! I am using rdkit in django app. The Compound model has a MolField.
I have trouble with using this implementation of get_prep_value in MolField:

    def get_prep_value(self, value):
        # convert the Molecule instance to the value used by the
        # db driver
        if isinstance(value, str):
            value = self.text_to_mol(value)
        if isinstance(value, Chem.Mol):
            value = memoryview(value.ToBinary())
        if value is None:
            return None
        return Func(value, function="mol_from_pkl")

But I fix it by change implementation to:

    def get_prep_value(self, value):
        # convert the Molecule instance to the value used by the
        # db driver
        if isinstance(value, str):
            value = self.text_to_mol(value)
        if value is None:
            return None
        return value.ToBinary()

Its fix my issue but I am new with rdkit and not shour what its correct way to serialize data to db.
Can someone answer me wich of method a more correct?

New release for conda-forge package

Hello!

I have created a recipe in conda-forge for django-rdkit (so that it's easily installable in chembience). Unfortunately, conda-forge expects an archive in the recipe, so for now it contains v0.1.0 which is not compatible with Django 3. Could you please create a tag/a release for the current state of your code? Thanks!

NameError: name 'forms' is not defined

Hello, thank you for this project that helped me a lot,
I'm using Django 1.11, I recently tried to use a molecule MolField in a django model and I got this error :
File "/opt/anaconda/lib/python3.6/site-packages/django_rdkit/models/fields.py", line 89, in formfield defaults = {'form_class': forms.CharField, 'strip': False, 'widget':forms.Textarea} NameError: name 'forms' is not defined

I corrected it by importing forms at the beggining of the file django_rdkit/models/fields.py :
from django import forms

Should it be corrected in the git repository ?

QMOL field

Hello! How to use qmol field. And what is difference between mol field and qmol? Looking at the code one gets the impression that there is no difference

Recent install on Mac unusable due to Python ImportError

A recent install (without conda) on Mac OSX 10.11.2 was unusable due to

$ python manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 327, in execute
    django.setup()
  File "/Library/Python/2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Library/Python/2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/Library/Python/2.7/site-packages/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Library/Python/2.7/site-packages/django_rdkit-0.0.4-py2.7.egg/django_rdkit/models/__init__.py", line 8, in <module>
    from django_rdkit.models.fields import *
  File "/Library/Python/2.7/site-packages/django_rdkit-0.0.4-py2.7.egg/django_rdkit/models/fields.py", line 10, in <module>
    from rdkit.DataStructs import ExplicitBitVect, SparseIntVect
ImportError: cannot import name SparseIntVect

In django_rdkit/models/fields.py, SparseIntVect is unused, so removing the import and then reinstalling w/ $ python setup.py install fixed it. SparseBitVect exists though, maybe that was the intention?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.