-
-

Python Bindings for Raylib 5.0

- +
+

Python Bindings for Raylib 5.5

+
+

Libraries: raymath, raygui, rlgl, physac and GLFW

+
+
+

Backends: Desktop, SDL, DRM, Web

Chatroom: Discord or Matrix

New CFFI API static bindings.

    @@ -114,21 +124,21 @@ original Raylib.

  • Faster, fewer bugs and easier to maintain than ctypes.

  • Commercial-friendly license.

  • Docstrings and auto-completion.

  • -
  • Now includes extra libraries: raymath, raygui, rlgl, physac and GLFW

Full documentation

+

Quickstart

-

pip3 install raylib

-
from pyray import *
-init_window(800, 450, "Hello")
-while not window_should_close():
-    begin_drawing()
-    clear_background(WHITE)
-    draw_text("Hello world", 190, 200, 20, VIOLET)
-    end_drawing()
-close_window()
+

pip3 install raylib==5.0.0.4

+
from pyray import *
+init_window(800, 450, "Hello")
+while not window_should_close():
+    begin_drawing()
+    clear_background(WHITE)
+    draw_text("Hello world", 190, 200, 20, VIOLET)
+    end_drawing()
+close_window()
 
@@ -140,12 +150,33 @@ close_window()

Then install

python3 -m pip install setuptools
-python3 -m pip install raylib
+python3 -m pip install raylib==5.0.0.4
 
-

On most platforms it should install a binary wheel (Windows 10 x64, MacOS 12 x64/arm64, Linux Ubuntu2004 x64/arm64).

-

If yours isn’t available then pip will attempt to build from source, in which case you will need to have Raylib development libs installed, e.g. +

On most platforms it should install a binary wheel. If yours isn’t available then pip will attempt to build from source, in which case you will need to have Raylib development libs installed, e.g. using homebrew, apt, etc.

+
+

Windows

+

Binaries require x64 Windows 10 or newer. (For x86 or older Windows you will have to build from source.)

+

Use an official Windows Python release rather than WSL, MSYS, etc.

+
+
+

MacOS

+

Binaries require arm64 MacOS 13 or x64 MacOS 12 or newer.

+

Older MacOS requires building from source but this is usually simple:

+
brew install pkg-config
+brew install raylib
+python3 -m pip install raylib==5.0.0.4
+
+
+
+
+

Linux

+

Binaries require OS newer than Ubuntu 2020, x64 or arm64. Otherwise build from source. +(Pip should attempt automatically but will need Raylib itself installed and also pkg-config.)

+

The arm64 builds are built on Raspberry Pi arm64 Bullseye +so may not work on other boards.

+

Raspberry Pi

Using on Rasperry Pi

@@ -158,13 +189,23 @@ using homebrew, apt, etc.