Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4863

Python • Re: Rpi5, pi3d, x11, uggg lol

$
0
0
OK, Well I finally got this figured out!
Fresh bookworm with desktop installation, boot to the CLI.
Screw messing around with the virtual environment, let the installs rip with --break-system-packages for pi3d and xinit.
sudo apt install xinit xserver-xorg --break-system-packages
install pi3d with pip3, sudo: sudo pip3 install pi3d --break-system-packages
sudo raspi-config and switch the advanced option for the display to the X11 server.

From the CLI, create a shell script:
nano ~/launch_pi3d.sh
add the following:

#!/bin/bash
# Set the display for the X server
export DISPLAY=:0
# Run the Python script
python3 /path/to/your_script.py

Make the script executable:
chmod +x ~/launch_pi3d.sh

Run the script from a CLI boot with:

sudo xinit ~/launch_pi3d.sh -- :0

add this into /etc/rc.local and it will boot right into your script.

Only took me like 6 days to figure this out. I would have thought this would have been something already documented at this point. Just glad I can move forward now!

Statistics: Posted by AGPowers — Sun Jan 19, 2025 4:04 am



Viewing all articles
Browse latest Browse all 4863

Trending Articles