Python 3

I Rasperrby Pi OS Buster installeras både Python 2 och Python 3 men Python 2 är default. Jag vill köra trean som standard vilket kräver lite pill.

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2

Verifiera att rätt version används med

python --version

Om det inte är trean som körs kan man tvinga vilken version man vill använda med

sudo update-alternatives --config python

Allt är inte förinstallerat för python3 så man får lägga till lite.

sudo apt install python3-rpi.gpio
Privacy Overview
Elofs projekt

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Necessary

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.