【发布时间】:2017-06-30 22:01:51
【问题描述】:
我正在使用 Python 编写一个脚本来处理我的博士期间的一些化学结构。我想为 python 安装 openbabel 库。我尽力了,但我无法在 Windows 上安装它。我之前在How do I install openbabel for Python 3.6 in Windows 10? 上发布了一个关于在 Windows 上安装它的问题,但找不到解决方案。该解决方案安装了库,但它不起作用并且无法连接到 SWIG。 不,我试图将它安装在我的办公室计算机上,这是过去 5 个小时的 mac,但我不知道发生了什么。 我尝试从 Opnbabel 的源代码安装它并将其与 python3 链接,但它出现了问题。 如果我使用以下命令:
cmake ../ -DPYTHON_BINDINGS=ON -DRUN_SWIG=ON
它成功地将它链接到我不想要的 Python 2.7。当我尝试以下选项时,它会给出如下所示的错误:
cmake ../ -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_BINDINGS=ON -DRUN_SWIG=ON
或
cmake ../ -DRUN_SWIG=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m -DPYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5m.dylib -DPYTHON_BINDINGS=ON
在大量成功输出后,最后给出以下错误:
-- Found PythonInterp: /usr/bin/python3.6 (found version "1.4")
-- Found SWIG: /usr/local/bin/swig (found version "3.0.12")
-- Found SWIG: /usr/local/bin/swig (found suitable version "3.0.12", minimum required is "2.0")
-- Found PythonLibs: /usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib (found version "3.6.0")
-- Python bindings will be compiled
CMake Error at scripts/CMakeLists.txt:120 (install):
install TARGETS given no LIBRARY DESTINATION for module target
"bindings_python".
CMake Error at scripts/CMakeLists.txt:123 (install):
install FILES given no DESTINATION!
CMake Error at scripts/CMakeLists.txt:126 (install):
install FILES given no DESTINATION!
-- Configuring incomplete, errors occurred!
See also "/usr/local/Cellar/obabel/openbabel-master/ali/CMakeFiles/CMakeOutput.log".
See also "/usr/local/Cellar/obabel/openbabel-master/ali/CMakeFiles/CMakeError.log".
我不确定为什么它将 Python 检测为 v1.4 -- Found PythonInterp: /usr/bin/python3.6 (found version "1.4") 而不是找到 v.3.5。
我也用 python 3.6 尝试了所有过程,但发生了同样的错误。我也在使用从 github 获得的 openbabel,据说它在以下帖子中使用这些命令:http://forums.openbabel.org/OpenBabel-for-Python-3-td4659432.html
但它也不起作用。
请帮助我,因为我需要这个模块来进行研究。
谢谢
【问题讨论】:
标签: python macos python-3.x macos-sierra openbabel