我开始使用rdkit,并尝试用postgres在Django中实现。因此,我用pip install rdkit-pypi在django虚拟环境中安装了rdkit,还安装了django-rdkit(https://github.com/rdkit/django-rdkit)。这个命令:python3 -c "from rdkit import Chem; print(Chem.MolToMolBlock(Chem.MolFromSmiles('C1CCC1')))"对我来说很好。但是当我运行迁移时,它失败了。错误是:
django.db.utils.OperationalError: could not open extension control file "/usr/share/postgresql/12/extension/rdkit.control": No such file or directory似乎无法用postgres创建墨盒rdkit。任何人都可以帮助我找到问题和解决方案(最好不要和Conda打交道,因为我以前从未使用过它)?非常感谢!
发布于 2022-09-08 02:55:56
好的,我会自己回答,并结束这个问题,因为这个项目运行良好。我必须使用conda和使用conda来创建一个rdkit扩展,因为postgres可以解决这个问题。要创建Rdkit-postgres墨盒,只需运行:
conda create -n environment
(environment) $ conda activate rdkit-postgres
(environment) $ conda install -c conda-forge postgresql
(environment) $ conda install -c rdkit rdkit-postgresql要用rdkit创建django,需要安装django-rdkit(https://github.com/rdkit/django-rdkit)。
需要提到的一点不同是,我手动创建了数据库中的扩展,而不是django-rdkit自动创建的扩展,这是因为在遇到相同情况时拒绝了一些权限。
https://stackoverflow.com/questions/73577562
复制相似问题