首页 > 解决方案 > 在 Colab 中安装 MeshPy

问题描述

我试图在 Colab 中安装 MeshPy,!pip install MeshPy但我得到了以下输出并且该软件包尚未安装。我会很感激任何建议。这是完整的输出

Collecting MeshPy

  Downloading 

https://files.pythonhosted.org/packages/90/03/3bb205ac46141074aeb561f5bbf60fb2214380aa6ac1435b49d275cf219a/MeshPy-2018.2.1.tar.gz (472kB)
    100% |████████████████████████████████| 481kB 25.8MB/s 

Collecting pytools>=2011.2 (from MeshPy)

  Downloading 

https://files.pythonhosted.org/packages/ac/a3/f54f7190315ad41b7334d8733350e7fcefded8f25e0b45e2329b80279921/pytools-2019.1.tar.gz (57kB)
    100% |████████████████████████████████| 61kB 22.3MB/s 

Requirement already satisfied: pytest>=2 in /usr/local/lib/python3.6/dist-packages (from MeshPy) (3.10.1)

Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from MeshPy) (1.14.6)

Collecting gmsh_interop (from MeshPy)
  Downloading 

https://files.pythonhosted.org/packages/a5/8c/62c40850d8e8a2c9c3d223c9b9456ed4431f02b0c45e16cc90bf0025fffe/gmsh_interop-2019.1.tar.gz

Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from MeshPy) (1.11.0)

Requirement already satisfied: decorator>=3.2.0 in /usr/local/lib/python3.6/dist-packages (from pytools>=2011.2->MeshPy) (4.3.2)

Collecting appdirs>=1.4.0 (from pytools>=2011.2->MeshPy)

  Downloading 

https://files.pythonhosted.org/packages/56/eb/810e700ed1349edde4cbdc1b2a21e28cdf115f9faf263f6bbf8447c1abf3/appdirs-1.4.3-py2.py3-none-any.whl

Requirement already satisfied: atomicwrites>=1.0 in /usr/local/lib/python3.6/dist-packages (from pytest>=2->MeshPy) (1.3.0)

Requirement already satisfied: setuptools in /usr/local/lib/python3.6/dist-packages (from pytest>=2->MeshPy) (40.8.0)

Requirement already satisfied: py>=1.5.0 in /usr/local/lib/python3.6/dist-packages (from pytest>=2->MeshPy) (1.8.0)

Requirement already satisfied: pluggy>=0.7 in /usr/local/lib/python3.6/dist-packages (from pytest>=2->MeshPy) (0.9.0)

Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.6/dist-packages (from pytest>=2->MeshPy) (18.2.0)

Requirement already satisfied: more-itertools>=4.0.0 in /usr/local/lib/python3.6/dist-packages (from pytest>=2->MeshPy) (6.0.0)

Building wheels for collected packages: MeshPy, pytools, gmsh-interop

  Building wheel for MeshPy (setup.py) ... error

  Failed building wheel for MeshPy

  Running setup.py clean for MeshPy

  Building wheel for pytools (setup.py) ... done

  Stored in directory: /root/.cache/pip/wheels/1b/f4/26/46b6cf949b3cccefcc41e6b526f7c16351a4a5c124fc6f6eaa

  Building wheel for gmsh-interop (setup.py) ... done

  Stored in directory: /root/.cache/pip/wheels/be/19/0b/76011e06f64c41e0dcfed58e171c091c31f2b499a981d8d773

Successfully built pytools gmsh-interop

Failed to build MeshPy

Installing collected packages: appdirs, pytools, gmsh-interop, MeshPy

  Running setup.py install for MeshPy ... error

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-matqpp2p/MeshPy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-8_339liz/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-matqpp2p/MeshPy/

标签: pythonpipinstallation

解决方案


您的错误中没有足够的信息。要查看确切原因,我们需要更长的回溯。

让我猜猜。我尝试自己安装 MeshPypip install MeshPy并收到关于缺席的错误pybind11。所以我跑了

pip install pybind11
pip install MeshPy

MeshPy 安装成功。


推荐阅读