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

error with mraa library on Python from Galileo #656

Closed
luisafernandarj opened this issue Feb 27, 2017 · 8 comments
Closed

error with mraa library on Python from Galileo #656

luisafernandarj opened this issue Feb 27, 2017 · 8 comments

Comments

@luisafernandarj
Copy link

Hi man, I need your help,

When I try to use mraa library for python, I have this error:

import mraa
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python2.7/site-packages/mraa.py”, line 32, in
_mraa = swig_import_helper()
File “/usr/lib/python2.7/site-packages/mraa.py”, line 28, in swig_import_helper
_mod = imp.load_module(‘_mraa’, fp, pathname, description)
ImportError: File not found

I used the steps in this page: https://github.com/intel-iot-devkit/mraa/blob/master/README.md
Installing on Intel 32bit Yocto based opkg image

For true, I’ve Intel Galileo 1Gen, and this SDImage is this: https://software.intel.com/en-us/iot/hardware/galileo/downloads

Latest Yocto* Poky Image (210 MB)

Can you help me please?, Thanks!

@arfoll
Copy link
Contributor

arfoll commented Feb 27, 2017 via email

@luisafernandarj
Copy link
Author

Uhhmmm... well.. this is the output...

root@clanton:/usr/lib/python2.7/site-packages# ls -l /usr/lib/python2.7/site-packages/mraa
-rwxr-xr-x 1 root root 263924 Feb 22 2017 /usr/lib/python2.7/site-packages/_mraa.so
-rw-r--r-- 1 root root 43310 Jan 1 04:58 /usr/lib/python2.7/site-packages/mraa.py
-rw-r--r-- 1 root root 49077 Jan 1 04:52 /usr/lib/python2.7/site-packages/mraa.pyo

How I can install mraa, so?
:(

@arfoll
Copy link
Contributor

arfoll commented Feb 27, 2017

So that looks very odd because it seems you have an updated _mraa.so but not an updated mraa.py by looking at the timestamps mraa.py should have the same as _mraa.so since that should be installed time. I'd recommend removing mraa from the package manager and installing it again, no idea what's gone wrong. Installing/compiling from source should give you a quick fix.

However i'm curious what's the ouput of cat /etc/os-release?

@luisafernandarj
Copy link
Author

I try to remove and installing again, with before comand, this is the output:

root@clanton:/usr/lib/python2.7/site-packages# ls -l /usr/lib/python2.7/site-packages/mraa
-rwxr-xr-x 1 root root 263924 Feb 22 2017 /usr/lib/python2.7/site-packages/_mraa.so
-rw-r--r-- 1 root root 43310 Feb 22 2017 /usr/lib/python2.7/site-packages/mraa.py
root@clanton:/usr/lib/python2.7/site-packages# python
Python 2.7.3 (default, Oct 16 2014, 16:04:29)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import mraa
Traceback (most recent call last):
File "", line 1, in
File "mraa.py", line 32, in
_mraa = swig_import_helper()
File "mraa.py", line 28, in swig_import_helper
_mod = imp.load_module('_mraa', fp, pathname, description)
ImportError: File not found

I tryed to install mraa in my PC, and had the same problem, only difference was the sentence: ImportError: libmraa.1, so I installed from this page http://ppa.launchpad.net/mraa/mraa/ubuntu/pool/main/m/mraa/ , and work it... but in this case, I don't know which file is not there...

The output of cat /etc/os-release is:
root@clanton:/usr/lib/python2.7/site-packages# cat /etc/os-release
cat: can't open '/etc/os-release': No such file or directory

Thanks for you help!!!

@arfoll
Copy link
Contributor

arfoll commented Feb 27, 2017

Ok my guess is that you haven't flash the uSD card correctly and are on the internal SPI image - check out the instructions here: https://software.intel.com/en-us/get-started-galileo-linux-step1 (there are some for windows too) you need to use dd to flash the image you cannot just copy it to the uSD card.

Grabbing files from launchpad is a very bad idea, they won't work as they are meant for x64 based systems.

@luisafernandarj
Copy link
Author

Okay, I'll try to install Linux again in the sd, and try the mraa library again. I will return to tell if it worked,

Thank you!!

@luisafernandarj
Copy link
Author

Yeah!!, That is The Solution, download the image and install it Completely. I forgot that I was using a copy-paste version to run only little sketch of Arduino and no-Python programs of the Intel Galileo.

root@galileo:~# cat /etc/os-release
ID=iot-devkit
NAME=iot-devkit (Intel IoT Development Kit)
VERSION=3.5 (tarsier)
VERSION_ID=3.5
PRETTY_NAME=iot-devkit (Intel IoT Development Kit) 3.5 (tarsier)

@arfoll
Copy link
Contributor

arfoll commented Feb 27, 2017

Glad that worked. Closing issue.

@arfoll arfoll closed this as completed Feb 27, 2017
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

2 participants