Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jpelletier opened this issue Apr 12, 2020 · 4 comments
Open

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

jpelletier opened this issue Apr 12, 2020 · 4 comments

Comments

@jpelletier
Copy link

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

@babourn
Copy link

babourn commented May 18, 2020

+1 Having the same issue with BMI160

@babourn
Copy link

babourn commented May 18, 2020

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.

@jpelletier
Copy link
Author

jpelletier commented Feb 1, 2021

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.

@g-vidal
Copy link
Contributor

g-vidal commented Feb 1, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants