Using Pythonpath with the Python Libraries
Created 31/01/2016 | Adding the library path to startup
This page details how to add the PYTHONPATH and PATH variables on the Raspbian “Wheezy” and "Jessie" image from http://www.raspberrypi.org/downloads to use with our Python 2 and 3 libraries allowing you to use the libraries from your scripts from any directory on your Raspberry Pi.
Step 1: Download and extract the library to the directory of your choice, i.e ABElectronics_Python_Libraries/ADCPi
Step 2: Use CD to change to the directory containing the library files.
Step 3: Use the pwd command to obtain the full directory path.
This will return the full path to the directory: /home/pi/Desktop/ABElectronics_Python_Libraries/ADCPi
Step 3 a: We now edit the .bashrc file to include the library folder in the PATH and PYTHONPATH variables
sudo nano ~/.bashrc
Step 4: Add the following lines to the .bashrc file at the end, replace this demo path to the correct location on your computer.
Save your changes and exit the Nano editor.
Step 5: Reboot to apply the changes
When your Raspberry Pi has rebooted you will now have PYTHONPATH to the library setup for Python 2 or 3 support.