Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum


2407 Views - Created 05/04/2016


Posted by:

Texy Avatar

Hi,I have been using the ADCPiPlus board for a while, but couldn't get the PYTHONPATH environmental to work so I just copied the relevant files to the same directory as the python script. I have just moved from Wheezy to Jessie on a raspberry pi 2 and rebuilding the OS for this project, but still have the same issue. The Libraries and PYTHONPATH are set to /home/pi/ABElectronics_Python_Libraries/ADCPi/ but it still replies with the error that it can't find the relevant files. Is the envirnomental PYTHONPATH supported?Also can you confirm that PYTHONPATH is cleared upon a reboot, as it appears to be.Thanks,Texy


Posted by:

JonWeston Avatar

I'm having this issue too on Pi 3


Posted by:

andrew Avatar

United Kingdom

andrew Twitter  andrew Website  

PYTHONPATH should work on the Raspberry Pi. I have just tried setting up a path to the ADCPi library folder on my Raspberry Pi 2 with the latest Jessi image and I could run the after moving it to the /home/pi/ folder.

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:

export PATH


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.

Sign in to post your reply

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.