简体   繁体   English

使用PyCharm运行Menpo和Menpofit

[英]Run Menpo and Menpofit with PyCharm

I trying to explore Menpo and Menpofit with PyCharm IDE. 我试图使用PyCharm IDE探索Menpo和Menpofit。 I have installed required packages but I have some issue: 我已经安装了必需的软件包,但是有一些问题:

  1. from .fastpwa import CLookupPWA; 从.fastpwa导入CLookupPWA; ImportError: cannot import name 'CLookupPWA' ImportError:无法导入名称“ CLookupPWA”
  2. from .normals import compute_normals; 从.normals导入compute_normals; ImportError: No module named 'menpo.shape.mesh.normals' ImportError:没有名为“ menpo.shape.mesh.normals”的模块

So how I can run Menpo and Menpofit with PyCharm? 那么,如何使用PyCharm运行Menpo和Menpofit?

How did you install the required packages? 您如何安装所需的软件包? With the conda instructions, or via pip ? 有了conda说明,还是通过pip

The error you are seeing there is because CLookupPWA and compute_normals are compiled Python extensions that need to be built before the package can be loaded. 您看到的错误是因为CLookupPWAcompute_normals是已编译的Python扩展,需要在加载包之前先进行构建。 The easiest way to do this is to use the make command in the Menpo top level, which runs python setup.py build_ext --inplace . 最简单的方法是在Menpo顶层使用make命令,该命令运行python setup.py build_ext --inplace

If you are on Windows, things start to get pretty tricky, because you need to be able to compile the code properly. 如果您使用的是Windows,那么事情就会变得很棘手,因为您需要能够正确地编译代码。 Take a look at the instructions here which try to explain how to properly set up Visual Studio 2008. 请查看此处的说明,这些说明试图解释如何正确设置Visual Studio 2008。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM