With older releases of the debian SW for the Dragonboard 410c (the 16.09 release) I was able to run the following line of python code with no issues:
However on the latest release (the 17.09 release, installed from SDCard, with no updates or changes of any kind not even ‘sudo apt-get update’) I get the following error:
ImportError: No module named pyupm_i2clcd
I looked around and tried installing pyupm with the following command:
sudo apt-get install python-upm
but apt-get happily tells me that pyupm is already installed.
Further hunting and I found the missing pyupm module in /usr/lib/aarch64-linux-gnu/python2.7/site-packages
I can make the import sort of work if I run the following command
However this only fixes the import command while running python as user linaro, however in order to actually access the i2c device I need to run python with sudo, and the PYTHONPATH fix doesn’t work.
I think the latest build has something missing, possibly presetting the PYTHONPATH, or adding something to the site file, or linking /usr/lib/aarch64-linux-gnu/sitepackages to /usr/local/python2.7/sitepackages .
What is the correct solution for this small issue?
Of course once I fixed that issue, another issue cropped up: importing pyupm_i2clcd issues an error:
File "/usr/lib/aarch64-linux-gnu/python2.7/site-packages/pyupm_i2clcd.py", line 988 SyntaxError: Non-ASCII character '\xc3' in file /usr/lib/aarch64-linux/gnu/python2.7/sitepackages/pyupm_i2clcd.py on line 989, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
There is something wrong with the library, I can fix this one by editing the pyupm_i2clcd.py file and changing the ‘\xc3’ characters to lower case ‘x’ in several places. These special characters are inside comments and make no difference to the functionality of the module.
Full Disclosure: I am an employee of Qualcomm Canada, any opinions I may have expressed in this or any other post may not reflect the opinions of my employer.