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 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.

cd ABElectronics_Python_Libraries/ADCPi

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.

export PATH


Save your changes and exit the Nano editor.

Step 5: Reboot to apply the changes

sudo reboot

When your Raspberry Pi has rebooted you will now have PYTHONPATH to the library setup for Python 2 or 3 support.




Products added to basket


Total (inc shipping)

CheckoutView Basket

Free Shipping on all orders over £30

Click to contact us.

Have any Questions?

Send us any questions about this page or product and we will reply within 24 hours.

Submit your Message


Have any Questions?

Thank you for contacting us.

We will respond to your enquiry in the next 24 hours.

You can find answers to many questions and additional product support in our Knowledge Base and the Community Forum.