没有名为"meshpy._triangle"的模块 [英] No module named 'meshpy._triangle'

查看:213
本文介绍了没有名为"meshpy._triangle"的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照ubuntu上此处的说明安装了Meshpy(使用python 2.7) 16.04 LTS并尝试在浏览到此处后运行示例meshpy的目录.我尝试运行的部分示例如下:

I installed meshpy (using python 2.7) following the instructions here on my ubuntu 16.04 LTS and trying to run examples from here after browsing into the directory of meshpy. Part of the example that I'm trying to run is below:

from __future__ import division
from __future__ import absolute_import

import meshpy.triangle as triangle

但我不断收到错误No module named meshpy._triangle 有人暗示我可能会缺少什么吗?

but I keep getting error No module named meshpy._triangle Does anyone have a hint of what I might be missing ?

推荐答案

经过一整天的劳动,我意识到我所拥有的python软件包不正确,并导致了冲突.首先从此处是我遵循的Meshpy安装文档的链接,这里是我意识到造成问题的逐点总结

After an entire day of labor I realized the python packages that I had were not correct and causing conflicts. To begin with here is the link to the installation documentation of meshpy which I followed Here is a pointwise summary of what I realized caused problem

  1. 第1步说,下载文件,使用文档中提供的命令将其解压缩,然后浏览到目录"MeshPy-XXXXX",其中"XXXXX"指的是版本.
  1. Step 1 says download the file, unzip it using the command given in the doc, and browse to the directory 'MeshPy-XXXXX', where 'XXXXX' refers to the version.

问题,因为该目录中缺少名为CMakeList.txt的文件,并且在步骤2中进行配置时,系统抱怨该文件丢失.

The issue in this step is that a file called CMakeList.txt is missing in this directory and while configuring in step 2 the system complains about the missing file.

解决方案是下载git版本,而不是按照步骤1第二部分中提到的直接下载,或将文件CMakeList.txt手动复制到MeshPy-XXXXX目录中.我选择了后一种解决方案.

The solution is to download the git version instead of the direct download as mentioned in the second part of step1 or manually copy the file CMakeList.txt into the MeshPy-XXXXX directory. I chose the latter solution.

  1. 在步骤2中,要求我们浏览到目录并在终端上发出命令./configure.这对我不起作用.该目录包含一个名为configure.py的脚本.因此,我改为发布python3.5 configure.py
  1. In step 2 asks us to browse to the directory and issue the command ./configure on the terminal. This didn't work for me. The directory contains a script called configure.py . Hence instead I issued python3.5 configure.py

如果发出python configure.py且python调用python2.7,则应确保python2.7具有matplotlib,作为pypy安装的numpy取决于这些软件包

If you issue python configure.py and python calling python2.7 then you should make sure python2.7 has matplotlib, numpy installed as meshpy depends on these packages

  1. 您需要发出命令python setup.py install step2 中的最后一个是棘手的部分,这一切使我发疯.首先,我发布了python setup.py,但是我应该做的是发布python3.5 setup.py(或者最好在bash中为python3.5创建一个别名).
  1. The last of step2 where you need to issue command python setup.py install is a tricky part where things went crazy for me. Firstly, I issued python setup.py but what I should have done is issuing python3.5 setup.py (or better creating an alias to python3.5 in bash).

当我纠正错误时,我开始同时遇到python2.7和python3.5的另一个错误,其最后三行如下所示:

When I pinned down the mistake, I started getting another error both with python2.7 and python3.5, last three lines of which looks like below :

bpl-subset/bpl_subset/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

当我在stackoverflow中查找可能的类似错误时,我来了

When I looked up stackoverflow for possible similar errors, I came across this article and used the second solution in the post and installed python2.7-dev/python3.5-dev which solved the problem .

这篇关于没有名为"meshpy._triangle"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆