Problem with Python on YUN Shield

I'm developing an application using a YUN shield V:2.4, its Python V:2.7 and an Arduino Mega 2560. This question is specifically about Python on the YUN shield.
I have successfully written an application using a collection of custom python modules residing in a local folder /mnt/sda1/cgi-bin. I had added PYTHONPATH=/mnt/sda1/cgi-bin to /etc/profile so that the Python system would find them. All was good until I installed the pyFirmata and pySerial packages for communication with the Mega2560 (more useful in my case than the Bridge library).

Now, Python cannot find the custom modules. Python does, indeed, still have the custom folder at the correct place in its search path as reported by a printout of sys.path.

Can anybody please suggest a fix for this problem.

Peter.