PYTHONPATH
The ADC Pi is an Analogue to Digital converter for the Raspberry Pi
05/04/2016
Posted by:
Texy
05/04/2016
Posted by:
JonWeston
05/04/2016
Posted by:
andrew
PYTHONPATH is cleared on reboot but you can get around this by adding the path into the ~/.bashrc file which is parsed on boot. Open the .bashrc file using nano with the following command.
sudo nano ~/.bashrc
Move to the end of the file and add the following lines:
PATH="${PATH}:/home/pi/ABElectronics_Python_Libraries/ADCPi"
export PATH
PYTHONPATH="${PYTHONPATH}:/home/pi/ABElectronics_Python_Libraries/ADCPi"
export PYTHONPATH
Hopefully, after you reboot the path will be visible to python so you will be able to run scripts which use the ADCPi library from anywhere in the file system.
I haven't tried this on the Raspberry Pi 3 as my development system is on a Raspberry Pi 2 but as they are both running the same version of Raspian Linux it should work fine. Just to make sure I will try setting up a new image on a Raspberry Pi 3 and check it works.
Forum Notice – Closure to New Posts
As part of our compliance with the UK’s Online Safety Act, the AB Electronics UK support forum is now closed to new posts and replies.
We understand the importance of continued support for our products, so if you have a technical query or require assistance, please use the Contact Form or consult our Knowledge Base for helpful articles and documentation.
We appreciate your understanding and continued support.
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.