This is a simple script to control your pwm fan on compute blade.
GPIO Zero is packaged in the apt repositories of Raspberry Pi OS, Debian and Ubuntu. It is also available on PyPI.
sudo apt update
sudo apt install python3-gpiozero
If you’re using another operating system on your Raspberry Pi, you may need to use pip to install GPIO Zero instead. Install pip using get-pip and then type:
sudo pip3 install gpiozero