Error installing p5 package: Failed building wheel for PyOpenGL-accelerate
Describe the bug
I encountered an error while trying to install the p5 package in Python. The installation process fails when building the wheel for the PyOpenGL-accelerate dependency. The error message and output are as follows:
To Reproduce
Run pip install p5 to install the p5 package.
Screenshots
Building wheel for PyOpenGL-accelerate (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for PyOpenGL-accelerate (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [36 lines of output]
Unable to import numpy, skipping numpy extension building
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-13-arm64-cpython-311
creating build/lib.macosx-13-arm64-cpython-311/OpenGL_accelerate
copying OpenGL_accelerate/__init__.py -> build/lib.macosx-13-arm64-cpython-311/OpenGL_accelerate
running build_ext
building 'OpenGL_accelerate.wrapper' extension
...
src/wrapper.c:27136:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
CYTHON_FALLTHROUGH;
^
src/wrapper.c:27147:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
CYTHON_FALLTHROUGH;
^
src/wrapper.c:28232:5: error: incomplete definition of type 'struct _frame'
__Pyx_PyFrame_SetLineNumber(py_frame, py_line);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for PyOpenGL-accelerate
Failed to build PyOpenGL-accelerate
ERROR: Could not build wheels for PyOpenGL-accelerate, which is required to install pyproject.toml-based projects
System information:
Python version: 3.11 Operating System: macOS (version 13.4.1, Apple Silicon M1)
Additional context
I have numpy installed separately in my Python environment. I am using a virtual environment. I would appreciate any assistance in resolving this issue. Thank you!
Thank you for submitting your first issue to p5py
3.11 is not supported yet. Can you try using 3.10
I am trying 3.10 version but still same error
@imhimansu28 Use version 3.8.
Consider using it with pyenv.
pyenv install 3.8
pyenv global 3.8
exec bash -l
If you're using ZSH try pyenv init first.
I had the same kind of error recently, it seems to be a mac specific issue and the fix is to have numpy installed before installing PyOpenGL-accelerate. I believe there is a need to move to a better dependency management than requirements.txt.
Any news on this? Is it still Python 3.8 that is the latest supported version?
The tests are running fine till 3.11 - https://github.com/p5py/p5/blob/master/.github/workflows/build-tests.yml#L16, Can you try again ?
I tried it today on my M3 mac with similar error as above.
What is the python version ? Can you share the setup steps as well, did you create a virtual environment as well ?
Hi
I used a virtual environment, Python 3.11.2. Tried to install using pip3.
Anders
16 apr. 2024 kl. 06:41 skrev Tushar @.***>:
What is the python version ? Can you share the setup steps as well, did you create a virtual environment as well ?
— Reply to this email directly, view it on GitHub https://github.com/p5py/p5/issues/439#issuecomment-2058216166, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVH4DNZGEZZ65OI5NDKXPDY5STX7AVCNFSM6AAAAAA2KHAPNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJYGIYTMMJWGY. You are receiving this because you commented.
Hi,
- Just went through the same obstacle to install the package on an Apple with M2, macOS 14.4.1 and Python 3.11.9 using pyenv and venv, it was not successful. The compilation of the PyOpenGL_accelerate package is the stumbling block.
Ah, one more detail, I used the requirements.txt from the repo to control the installation with pip inside a fresh environment. Codeclub.org is now using the p5 package for their new Python courses, so it would be really good if the package could also run on an Apple Silicon machine. I am happy to give feedback to help in the process.
Hey @mikefromd I will try to take a look on my Mac - but it might take some time as I am quite busy with other stuff. I tested this with m2 sometime back, but you can try commenting out the pyopengl_accelarate dependency.
Curious if any further guidance on this thread. I'm on an M1, Sonoma 14.5, Python 3.12.2, trying to get PyOpenGL as a dependency for running a USD pipeline. Same "ERROR: Failed building wheel for PyOpenGL_accelerate"
@wrsmith108 you can skip installing PyOpenGL_accelerate as I believe that library was added to help in better 3D rendering. For the failing build, did you tried checking out open issues in PyOpenGL_accelerate project?
TY @tushar5526 - I was building on my own machine and will redo a greenfield deployment for a USD pipeline for 3D rendering where this is a dependency. Ticket can be closed. Cheers.
I tried on M1 today. I tested 3.8, 3.9, 3.10 and 3.11 and all failed.
conda create -n p5 python=3.8 -y
conda activate p5
pip install numpy PyOpenGL
pip install PyOpenGL-accelerate
I have the same problem using Mac M3 I opened an issue in pyopengl project, but the community seems to be kind of dead there.
Any alternatives on how to fix this without using opengl-accelerate?
I managed to install p5 in an M3 without opengl-accelerate but I am not sure which are the limitations yet. How do to it.
- Download the requirements file
- Delete the line of opengl-accelerate
- Install reqs
pip install -r requirements.txt - Install p5 with no dependencies
pip install p5 --no-dependencies
With this steps I can run some of the demo examples. If opengl-accelerate is a requirement I guess that at some point some things are going to break. Don't know what exactly.
Hi! I just wanted to follow up here. Were there any updates to help install opengl-accelerate for Mac?