Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing p5 package: Failed building wheel for PyOpenGL-accelerate #439

Closed
imhimansu28 opened this issue Jul 14, 2023 · 21 comments
Closed

Comments

@imhimansu28
Copy link

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!

@github-actions
Copy link
Contributor

Thank you for submitting your first issue to p5py

@tushar5526
Copy link
Member

3.11 is not supported yet. Can you try using 3.10

@imhimansu28
Copy link
Author

I am trying 3.10 version but still same error

@hvitis
Copy link
Contributor

hvitis commented Sep 30, 2023

@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.

@tushar5526
Copy link
Member

tushar5526 commented Nov 17, 2023

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.

@mannesson
Copy link

Any news on this? Is it still Python 3.8 that is the latest supported version?

@tushar5526
Copy link
Member

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 ?

@mannesson
Copy link

I tried it today on my M3 mac with similar error as above.

@tushar5526
Copy link
Member

What is the python version ? Can you share the setup steps as well, did you create a virtual environment as well ?

@mannesson
Copy link

mannesson commented Apr 16, 2024 via email

@mikefromd
Copy link

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.

@mikefromd
Copy link

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.

@tushar5526
Copy link
Member

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.

@wrsmith108
Copy link

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"

@tushar5526
Copy link
Member

@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?

@tushar5526 tushar5526 reopened this Jun 8, 2024
@wrsmith108
Copy link

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.

@kylemcdonald
Copy link

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

@ivanlen
Copy link

ivanlen commented Jun 12, 2024

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?

@ivanlen
Copy link

ivanlen commented Jun 12, 2024

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.

  1. Download the requirements file
  2. Delete the line of opengl-accelerate
  3. Install reqs pip install -r requirements.txt
  4. 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.

@AkashShan1
Copy link

Hi! I just wanted to follow up here. Were there any updates to help install opengl-accelerate for Mac?

@WaleedFarooq51
Copy link

Has anybody found the solution to this problem? I am facing the same issue. I am using Python version 3.12.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants