Raspbian中安裝了兩個Python版本,分別是2.7.3和3.2.2。Python2.x的安裝包會壹python為前綴,而Python3.x的安裝包回憶python3為前綴。
Python2安裝GPIO庫需要輸入命令:
sudo <a href="/s?wd=apt-get&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1dBrH9BPHczPA7bPWn4nWPh0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EPjn1nH0znjb4nHmznWmknWfY" target="_blank"class="baidu-highlight">apt-get</a> install python-rpi.gpio
Python3安裝GPIO庫需要輸入命令:
sudo <a href="/s?wd=apt-get&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1dBrH9BPHczPA7bPWn4nWPh0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EPjn1nH0znjb4nHmznWmknWfY" target="_blank"class="baidu-highlight">apt-get</a> install python3-rpi.gpio