2013-11-10 43 views
0

在我看来,CGAL文档没有很好的记录。我完全失去了如何在Python中使用它们的包。我如何在Python中使用CGAL?

我已经在我的Windows安装CGAL-4.3,我试图做

In [233]: """ python 2.4""" 
    .....: from CGAL.Alpha_shapes_2 import * 
    .....: from CGAL.Triangulations_2 import Delaunay_triangulation_2 
    .....: from CGAL.Kernel import * 
    .....: from ShapeHelper import * 
    .....: import numpy as np 
    .....: import sys 

错误消息

--------------------------------------------------------------------------- 
ImportError        Traceback (most recent call last) 
<ipython-input-233-4807de38949d> in <module>() 
     1 """ python 2.4""" 
----> 2 from CGAL.Alpha_shapes_2 import * 
     3 from CGAL.Triangulations_2 import Delaunay_triangulation_2 
     4 from CGAL.Kernel import * 
     5 from ShapeHelper import * 

ImportError: No module named CGAL.Alpha_shapes_2 

我应该怎么做,这样我可以正确导入这些模块?

我可以导入它们后,就像在python中使用任何其他模块一样简单。

+0

您是否已将'cgal-python'添加到您的PYTHONPATH中? – tijko

+0

@tijko是的,奇怪ImportError:没有模块名为Kernel –

+0

不,我认为这是特定的包。你能否帮忙检查一下?我怀疑里面有东西丢失。 https://gforge.inria.fr/frs/shownotes.php?release_id=3674 –

回答

5

有一些Unofficial binaries与Python开箱即用的科学扩展包不兼容。

在提供的链接中有一个用于CGAL-python的方法,有一些方法。

+0

像魔术一样工作!它为Windows用户(特别是新手)节省了很多麻烦! :d –