运行 Menpo 和 Menpofit PyCharm

Run Menpo and Menpofit with PyCharm

我正在尝试使用 PyCharm IDE 探索 Menpo 和 Menpofit。我已经安装了所需的软件包,但我遇到了一些问题:

  1. 从 .fastpwa 导入 CLookupPWA; 导入错误:无法导入名称 'CLookupPWA'
  2. 从 .normals 导入 compute_normals; 导入错误:没有名为 'menpo.shape.mesh.normals'
  3. 的模块

那么我如何 运行 Menpo 和 Menpofit PyCharm?

您是如何安装所需的软件包的?使用 conda 指令,还是通过 pip

您看到的错误是因为 CLookupPWAcompute_normals 是编译的 Python 扩展,需要在加载包之前构建。最简单的方法是在 Menpo 顶层使用 make 命令,它运行 python setup.py build_ext --inplace

如果您在 Windows,事情开始变得相当棘手,因为您需要能够正确编译代码。查看说明 here,它试图解释如何正确设置 Visual Studio 2008。