2013-11-10 48 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 –