1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Python / Mac] PyOpenGL-accelerate の pip install に失敗する時の対策

Posted at

環境

item version など
OS MacOS Ventura 13.6
CPU Apple M2
Python 3.10

1. エラー発生時の状況

1-1. requirements.txt からインストールしようとして失敗

requirements.txt
PyOpenGL==3.1.5
PyOpenGL-accelerate==3.1.5
% pip install -r requirements.txt

PyOpenGL-accelerate のインストールに失敗した。

1-2. 直接 pip インストールしようとして失敗

% pip install PyOpenGL-accelerate

失敗したのだけど、以下のようなエラー文が気になった。

src/numpy_formathandler.pyx:22:42: 'Py_intptr_t' is not a type identifier

2. 解決策

'Py_intptr_t' is not a type identifier の解決策は以下の記事に記されていた。

以下のように requirements.txt を修正して、

requirements.txt
# PyOpenGL==3.1.5
# PyOpenGL-accelerate==3.1.5
PyOpenGL @ git+https://github.com/mcfletch/pyopengl.git@release-3.1.8#egg=PyOpenGL
PyOpenGL_accelerate @ git+https://github.com/mcfletch/pyopengl.git@release-3.1.8#egg=PyOpenGL_accelerate&subdirectory=accelerate

再度 requirements.txt 経由で install したところ、 install build に成功した。

% pip install -r requirements.txt

...

Building wheels for collected packages: PyOpenGL, PyOpenGL_accelerate
  Building wheel for PyOpenGL (pyproject.toml) ... done
  Created wheel for PyOpenGL: filename=PyOpenGL-3.1.7-py3-none-any.whl size=2416925 sha256=799e60055ec527f35e8b8034be4be6d5df5555b52d7e454a58f8e333bd4cbc45
  Stored in directory: /private/var/folders/7r/d08538nj63ncgxpk9jwhpxsc0000gp/T/pip-ephem-wheel-cache-qinpz9cd/wheels/31/bb/6f/04b0198944916ae4cf032a6516ab8ed05dbf57a4f7def5ab40
  Building wheel for PyOpenGL_accelerate (pyproject.toml) ... done
  Created wheel for PyOpenGL_accelerate: filename=PyOpenGL_accelerate-3.1.7-cp310-cp310-macosx_13_0_arm64.whl size=442786 sha256=dd68ae1bb9376176b59f03b1df5afc5e69cfaf6e31a65548858683f09cf8fea0
  Stored in directory: /private/var/folders/7r/d08538nj63ncgxpk9jwhpxsc0000gp/T/pip-ephem-wheel-cache-qinpz9cd/wheels/a5/37/11/3ff3b1dc61f82d1a206303cd3aeda375c65dac6d7334f6b62e
Successfully built PyOpenGL PyOpenGL_accelerate

...
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?