之前我问过如何为macoshere安装openbabel。现在我还需要安装openbabel python包装程序pybel。我尝试了pip install pybel
,然后安装了它。然后,当我在学习教程时
import openbabel
import pybel
mymol = pybel.readstring("smi", "CCCC")
我得到了以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'pybel' has no attribute 'readstring'
原来其他人也有类似的问题,事实上,我在mailing list中发现,我引用
'I guess you installed pybel via
pip install pybel
, which is the "wrong" pybel'
然后他们给出了一个pip install openbabel
的解决方案,这对于macos是不可能的
A solution是使用conda
来安装openbabel,但我没有使用conda,我希望保持这种方式,因此我正在寻找一种不需要conda
的解决方案
我找到了解决方案,您可以
brew install open-babel
然后给出自制python站点包库的路径。对我来说,以下工作:那你可以
等等
我也有同样的问题。它使用以下代码:
相关问题 更多 >
编程相关推荐