upm icon indicating copy to clipboard operation
upm copied to clipboard

ImportError: cannot import name 'pyupm_jhd1313m1' from 'upm'

Open jpelletier opened this issue 4 years ago • 4 comments

When trying to run an example, it display this message.

jpelletier avatar Apr 12 '20 23:04 jpelletier

+1 Having the same issue with BMI160

babourn avatar May 18 '20 19:05 babourn

Partial fix/ possible issue with the install: I copied two python files into dist-packages in order to give python 3 access to the *.py files rather than the *.so files

sudo cp build/src/bmi160/python3.5/pyupm_bmi160.py /usr/local/lib/python3.5/dist-packages/upm sudo cp build/interfaces/python3.5/pyupm_interfaces.py /usr/local/lib/python3.5/dist-packages/upm

and that seemed to get everything working for my accelerometer.

babourn avatar May 18 '20 20:05 babourn

I tried babourn's fix (copied the python files from the upm library, cloned from github). files to copy: upm/build/src/lcd/python3.9/pyupm_lcd.py upm/build/src/jhd1313m1/python3.9/pyupm_jhd1313m1.py upm/build/interfaces/python3.9/pyupm_interfaces.py

It worked for the LCD. There is a test program in humid_temp (examples from the Sensor mezzanine). python3 test_lcd.py

There is another issue preventing the communication between the dragonboard and the arduino.

jpelletier avatar Feb 01 '21 18:02 jpelletier

Hi @jpelletier I have not been on upm for long I did not take the time to read what happened and I might be out of the track, but I have compiled mraa and upm to put them in a raspberryPi image I am distributing to colleagues. I face the same problem The reason is : In folder /usr/lib/pythonX.Y/dist-packages/upm thereare only _pyupm_*.so libraries and no pyupm_*.py this could be normal if the __init__.py file contained all the necessary commands to retrieve module names from the libraries and unfortunately it is empty ! The workaround I found was to copy all.py files from the src/pythonX.Y and interfaces/pythonX.Y folder . Your problem may appear because of a dependency or interface problem.

I am using jhd1313m1 BME280 TSL2561 MCP9808 as a mini-weatherstation demo and everything is OK with upm.

here is the command I used in case it helps :

from build folder

for i in python2.7 python3.7 ; do sudo cp src//$i/.py /usr/lib/$i/dist-packages/upm/; done for i in python2.7 python3.7 ; do sudo cp interfaces/$i/*.py /usr/lib/$i/dist-packages/upm/; done

g-vidal avatar Feb 01 '21 19:02 g-vidal