Академический Документы
Профессиональный Документы
Культура Документы
Written by Peter Dalmaris as a resource for students of the Raspberry Pi: Full Stack course
I m p or t a n t
If you are using the Raspberry Pi 3, you will need to use MINIBIAN 2016-03-12, which works
without any issues (tested with Python 2.7)
Instructions
1. Download the image from: https://minibianpi.wordpress.com/download/
2. Extract the contents
Note: The exact way of doing it, depends on your OS.
3. Get the location of the SD card using the Disk Utility.
Note: depending on your OS, you need to find out the SD card device on your file system.
4. Unmount the SD card
Note: Again, this depends on your OS.
5. Go to the terminal
6. Write the image to the SD card:
sudo dd bs=1m if=path_of_your_image.img of=/dev/rdisk4
Note: Again, this depends on your OS.
7. Insert the SD card to the RPi, connect it to Ethernet and Power
8. Use SSH to connect to the RPi: ssh root@192.168.111.63
Use password: raspberry
9. Update: apt-get update
10. Upgrade: apt-get upgrade
11. Install Raspiconfig: apt-get install raspi-config
12. Use Raspiconfig to expand the file system: raspi-config
Note: Reboot and reconnect
13. Install prerequisites:
apt-get install build-essential
apt-get install libncurses5-dev libncursesw5-dev libreadline6-dev
apt-get install libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
14. Install Python dev tools: apt-get install python-dev
15. Install SSL/TLS support for pip: apt-get install libssl-dev openssl
16. Install vim: apt-get install vim
Which Python?
From here on choose to install either Python 3 or Python 2. The later works with all Python
scripts in the course. Python 3 is new and as far as software for the RPi is concerned,
experimental, with lots of bugs.
2
If you choose to proceed with Python 2, you can either use the system Python 2.7.9
interpreter, or setup a virtual environment for the application only with its own Python 2.7.9
interpreter. The benefit of using the virtual environment is that the application is self
contained, not dependent on the system Python, and can be changed/upgraded without
affecting the system.
I m p or t a n t
There seem to be problems with Python 3 and various libraries needed for the RPi. So, unless
you are a Python expert I recommend Python 2 until these issues are resolved. Minibian
Jessie comes with Python 2.7.9, which is what we'll use here.
location /static {
root /var/www/lab_app/;
}