【问题标题】:How may I use CGAL in Python?如何在 Python 中使用 CGAL?
【发布时间】:2013-11-10 04:49:25
【问题描述】:

在我看来,CGAL 文档没有得到很好的记录。我完全不知道如何在 Python 中使用他们的包。

我已经在我的 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 中使用任何其他模块一样简单。

【问题讨论】:

  • 您是否已将 cgal-python 添加到您的 PYTHONPATH 中?
  • @tijko 是的,奇怪的是 ImportError: No module named Kernel
  • 不,我认为是这个特殊的包。你能帮忙检查一下吗?我怀疑里面少了点什么。 gforge.inria.fr/frs/shownotes.php?release_id=3674
  • @tijko 如果您可以尝试将其导入您的python,那就太好了。我认为它也行不通...
  • 你用的是什么windows版本?

标签: python cgal


【解决方案1】:

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

在提供的链接中有一个用于 CGAL-python 的链接,有点下。

【讨论】:

  • 像魔术一样工作!它为Windows用户(尤其是新手)省去了很多麻烦! :D
猜你喜欢
  • 2014-06-06
  • 1970-01-01
  • 2014-05-13
  • 1970-01-01
  • 2015-10-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-05
相关资源
最近更新 更多