There were issues when the Pi's OS upgraded python from 2 to 3 back in 2021. Check out these threads: