Problems with python-upm: Cannot import upm


#1

sudo apt-get install libupm-dev is not working i tried to import upm not it says module not found
but import mraa is working fine


Upcoming Debian April release for DB410c-- call for testing
#2

libXXX-dev is usually for C development but you said you tried import upm which suggests you are using python rather then C. For python packages would usually look like python-XXX (e.g. python-upm).


#3


sir, u can see here it says upm is already


#4

Hi @alokm014,

Can you try executing the python interpreter as Sudo?

$ sudo python

Thanks,
Mani


#5

yes, i tried but result is same :frowning:


#6

Sorry, just remembered there are some known probems with this package. See:
https://bugs.96boards.org/show_bug.cgi?id=457

In short the workaround you need are:

  • Run export PYTHONPATH=/usr/lib/aarch64-linux-gnu/python2.7/site-packages/ (this is a bit of a pain because it stops sudo working correctly.
  • Apply additional special changes if you want pyupm_i2clcd to work correctly (remove the non-ASCII characters from the comments)
  • You can’t import upm directly (I think because the package is too old). Try to import the modules directly: import pyupm_a110x or alternatively if you are working with examples that use the following idiom from upm import pyupm_a110x as upmA110x then change them to import pyupm_a110x as upmA110x instead.

#7

ok let suppose i don’t have upm now tell me what is the first step
is there any tutorial video on that how to use upm libraries


#8

You need to build and install libupm from source as mentioned here.

PS: I assume that you have installed MRAA