Git Product home page Git Product logo

Comments (6)

electronstudio avatar electronstudio commented on August 18, 2024

Seems like it hasn't correctly linked against OpenGL. But it ought to give that error at build time, not run time. Make sure it's using the wheel you built and not some other one. I do fortunately have a RPI3 so I can test it... but it works fine for me. Maybe ask on Raylib Discord.

pi@raspberrypi:~ $ python3 --version
Python 3.9.2

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 5.10.63-v7+ #1488 SMP Thu Nov 18 16:14:44 GMT 2021 armv7l GNU/Linux

pi@raspberrypi:~ $ pip3 install raylib
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting raylib
  Downloading raylib-4.0.0.6.tar.gz (61 kB)
     |████████████████████████████████| 61 kB 92 kB/s 
Requirement already satisfied: cffi>=1.14.6 in ./.local/lib/python3.9/site-packages (from raylib) (1.15.0)
Requirement already satisfied: inflection in ./.local/lib/python3.9/site-packages (from raylib) (0.5.1)
Requirement already satisfied: pycparser in ./.local/lib/python3.9/site-packages (from cffi>=1.14.6->raylib) (2.21)
Building wheels for collected packages: raylib
  Building wheel for raylib (setup.py) ... done
  Created wheel for raylib: filename=raylib-4.0.0.6-cp39-cp39-linux_armv7l.whl size=1933676 sha256=225b1e6727631d481f8bb6c457cd0d169598c95c39b46d061e0ec343ad04cbc8
  Stored in directory: /home/pi/.cache/pip/wheels/15/9c/0f/f60a7e1275a3b946996840e7962ec62d434e3807277f308310
Successfully built raylib
Installing collected packages: raylib
Successfully installed raylib-4.0.0.6

pi@raspberrypi:~ $ python3 test.py
RAYLIB STATIC 4.0.0.6 LOADED
INFO: Initializing raylib 4.0
INFO: DISPLAY: Device initialized successfully
INFO:     > Display size: 3440 x 1440
INFO:     > Screen size:  800 x 450
INFO:     > Render size:  800 x 450
INFO:     > Viewport offsets: 0, 0
INFO: GLAD: OpenGL extensions loaded successfully
INFO: GL: Supported extensions count: 200
INFO: GL: OpenGL device information:
INFO:     > Vendor:   Mesa/X.org
INFO:     > Renderer: llvmpipe (LLVM 11.0.1, 128 bits)
INFO:     > Version:  4.5 (Core Profile) Mesa 20.3.5
INFO:     > GLSL:     4.50
INFO: GL: DXT compressed textures supported
INFO: GL: ETC2/EAC compressed textures supported
INFO: TEXTURE: [ID 1] Texture loaded successfully (1x1 | R8G8B8A8 | 1 mipmaps)
INFO: TEXTURE: [ID 1] Default texture loaded successfully
INFO: SHADER: [ID 1] Vertex shader compiled successfully
INFO: SHADER: [ID 2] Fragment shader compiled successfully
INFO: SHADER: [ID 3] Program shader loaded successfully
INFO: SHADER: [ID 3] Default shader loaded successfully
INFO: RLGL: Render batch vertex buffers loaded successfully in RAM (CPU)
INFO: RLGL: Render batch vertex buffers loaded successfully in VRAM (GPU)
INFO: RLGL: Default OpenGL state initialized successfully
INFO: TEXTURE: [ID 2] Texture loaded successfully (128x128 | GRAY_ALPHA | 1 mipmaps)
INFO: FONT: Default font loaded successfully (224 glyphs)
INFO: TEXTURE: [ID 2] Unloaded texture data from VRAM (GPU)
INFO: SHADER: [ID 3] Default shader unloaded successfully
INFO: TEXTURE: [ID 1] Default texture unloaded successfully
INFO: Window closed successfully

from raylib-python-cffi.

electronstudio avatar electronstudio commented on August 18, 2024

I do recall that Raylib has issues with Pi support, and I think only works on certain versions of Raspbian because Raspbian keeps changing how the OpenGL drivers work.

from raylib-python-cffi.

sdillard avatar sdillard commented on August 18, 2024

Thanks for the reply. Doing a clean build of my pi and moving to Buster. Will report back and close/update this soon. I did notice that my python was not able to use the wheel and ran the setup.py, so I'll make sure I have wheel support working first.

from raylib-python-cffi.

sdillard avatar sdillard commented on August 18, 2024

I'm closing this as I worked around it, but I could not get this working. I did a clean install with Buster on raspian lite, installed dependencies, built raylib, got pkg-config working (that seemed more difficult than expected), and raylib installed, and pip installs fine, but it gave cffi errors whenever I try to run. I then installed raylib_dynamic and it works just fine, so I'm going with it. I do think complete steps on a pi would be useful to document, but maybe it just isn't that common to do what I'm doing. Thanks again for the reply.

from raylib-python-cffi.

electronstudio avatar electronstudio commented on August 18, 2024

We did actually have some tutorial for Pi in the docs, written by the last person who got it working. But Pi changed and those steps didn’t work any more! I don’t have time right now, especially since it works for me, but when/if I do I will try a from scratch install and see if I can reproduce.

sometimes people on the discord have more free time, still might be worth asking there.

from raylib-python-cffi.

electronstudio avatar electronstudio commented on August 18, 2024

Everything should now work on RPI3 (and 4 I presume) Bullseye with Raylib X11 (PLATFORM_DESKTOP) and with Raylib PLATFORM_DRM.

Older OSes and Raylib PLATFORM_RPI probably wont work.

See https://github.com/electronstudio/raylib-python-cffi/blob/master/RPI.rst

Please reopen if not working.

from raylib-python-cffi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.