Community
cancel
Showing results for 
Search instead for 
Did you mean: 
CChir1
Novice
1,518 Views

while trying to import nfc i am getting these errors in my galileo gen2?

Jump to solution

Python 2.7.3 (default, May 12 2016, 08:33:18)

[GCC 4.9.1] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import nfc

Traceback (most recent call last):

File "", line 1, in

File "/usr/lib/python2.7/site-packages/nfc/__init__.py", line 26, in

from clf import ContactlessFrontend

File "/usr/lib/python2.7/site-packages/nfc/clf/__init__.py", line 35, in

from . import device

File "/usr/lib/python2.7/site-packages/nfc/clf/device.py", line 39, in

from . import transport

File "/usr/lib/python2.7/site-packages/nfc/clf/transport.py", line 32, in

import usb1 as libusb

File "/usr/lib/python2.7/site-packages/usb1/__init__.py", line 61, in

from . import libusb1

File "/usr/lib/python2.7/site-packages/usb1/libusb1.py", line 199, in

libusb = _loadLibrary()

File "/usr/lib/python2.7/site-packages/usb1/libusb1.py", line 173, in _loadLibrary

return dll_loader('libusb-1.0' + suffix, **loader_kw)

File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__

self._handle = _dlopen(self._name, mode)

OSError: libusb-1.0.so: cannot open shared object file: No such file or directory

0 Kudos
1 Solution
idata
Community Manager
53 Views

Hello ChiChi,

 

 

Thanks for reaching out!

 

 

I tested it and got the same error messages as you. It seems that it is simply a dependency issue. These are the steps I took to fix it:

 

 

pip install -U nfcpy

 

pip install clf

 

pip install pyusb

 

opkg update

 

opkg install libusb-1.0-0 libusb-1.0-dbg libusb-1.0-dev libusb-0.1-staticdev

 

 

After doing this I imported the nfc library and no errors were shown.

 

 

I hope this information helps you,

 

Pedro M.

View solution in original post

7 Replies
idata
Community Manager
54 Views

Hello ChiChi,

 

 

Thanks for reaching out!

 

 

I tested it and got the same error messages as you. It seems that it is simply a dependency issue. These are the steps I took to fix it:

 

 

pip install -U nfcpy

 

pip install clf

 

pip install pyusb

 

opkg update

 

opkg install libusb-1.0-0 libusb-1.0-dbg libusb-1.0-dev libusb-0.1-staticdev

 

 

After doing this I imported the nfc library and no errors were shown.

 

 

I hope this information helps you,

 

Pedro M.

View solution in original post

CChir1
Novice
53 Views

Hello pedro,

while going for pip install clf i am getting these error for no space left on device but i have lot's of space in it..

Downloading/unpacking requests>=2.3.0 (from clf)

Downloading requests-2.13.0.tar.gz (557kB): 557kB downloaded

Running setup.py egg_info for package requests

warning: no files found matching 'test_requests.py'

warning: no files found matching 'requirements.txt'

Installing collected packages: clf, Pygments, docopt, requests

Running setup.py install for clf

error: could not create '/usr/lib/python2.7/site-packages/clf': No space left on device

Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/clf/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ORHTfd-record/install-record.txt --single-version-externally-managed:

running install

running build

running build_py

creating build

creating build/lib

creating build/lib/clf

copying clf/exceptions.py -> build/lib/clf

copying clf/__init__.py -> build/lib/clf

copying clf/constants.py -> build/lib/clf

copying clf/command.py -> build/lib/clf

copying clf/api.py -> build/lib/clf

running egg_info

writing requirements to clf.egg-info/requires.txt

writing clf.egg-info/PKG-INFO

writing top-level names to clf.egg-info/top_level.txt

writing dependency_links to clf.egg-info/dependency_links.txt

writing entry points to clf.egg-info/entry_points.txt

warning: manifest_maker: standard file '-c' not found

reading manifest file 'clf.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

writing manifest file 'clf.egg-info/SOURCES.txt'

running install_lib

creating /usr/lib/python2.7/site-packages/clf

error: could not create '/usr/lib/python2.7/site-packages/clf': No space left on device

----------------------------------------

Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/clf/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ORHTfd-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/clf

Storing complete log in /home/root/.pip/pip.log

Traceback (most recent call last):

File "/usr/bin/pip", line 9, in

load_entry_point('pip==1.3.1', 'console_scripts', 'pip')()

File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 149, in main

return command.main(args[1:], options)

File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 182, in main

log_fp.write(text)

IOError: [Errno 28] No space left on device

CChir1
Novice
53 Views

hello pedro,

after carefully doing above steps i am getting a new error

Type "help", "copyright", "credits" or "license" for more information.

>>> import nfc

Traceback (most recent call last):

File "", line 1, in

File "/usr/lib/python2.7/site-packages/nfc/__init__.py", line 26, in

from clf import ContactlessFrontend

File "/usr/lib/python2.7/site-packages/nfc/clf/__init__.py", line 35, in

from . import device

File "/usr/lib/python2.7/site-packages/nfc/clf/device.py", line 39, in

from . import transport

File "/usr/lib/python2.7/site-packages/nfc/clf/transport.py", line 32, in

import usb1 as libusb

File "/usr/lib/python2.7/site-packages/usb1/__init__.py", line 61, in

from . import libusb1

File "/usr/lib/python2.7/site-packages/usb1/libusb1.py", line 199, in

libusb = _loadLibrary()

File "/usr/lib/python2.7/site-packages/usb1/libusb1.py", line 173, in _loadLibrary

return dll_loader('libusb-1.0' + suffix, **loader_kw)

File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__

self._handle = _dlopen(self._name, mode)

OSError: /lib/libusb-1.0.so: file too short

please ignore the post which i had posted about second command error..

CChir1
Novice
53 Views

All the commands which were stated above with pip and opkg were executed syccessfully..

idata
Community Manager
53 Views

Hi ChiChi,

 

 

I'm confused, do you still need help? Or, did my previous suggestion helped?

 

 

The error messages you received simply let you know that your board's memory was full, so, packages were not able to be installed. If you are still receiving that error message, I suggest you to flash your SD with a fresh image and try again.

 

 

Let me know.

 

Pedro M.
CChir1
Novice
53 Views

Hello pedro,

Commands you told me worked and packages got installed successfully but I am getting a new error while importing NFC that is file is too short ..

Type "help", "copyright", "credits" or "license" for more information.

>>> import nfc

Traceback (most recent call last):

File "", line 1, in

File "/usr/lib/python2.7/site-packages/nfc/__init__.py", line 26, in

from clf import ContactlessFrontend

File "/usr/lib/python2.7/site-packages/nfc/clf/__init__.py", line 35, in

from . import device

File "/usr/lib/python2.7/site-packages/nfc/clf/device.py", line 39, in

from . import transport

File "/usr/lib/python2.7/site-packages/nfc/clf/transport.py", line 32, in

import usb1 as libusb

File "/usr/lib/python2.7/site-packages/usb1/__init__.py", line 61, in

from . import libusb1

File "/usr/lib/python2.7/site-packages/usb1/libusb1.py", line 199, in

libusb = _loadLibrary()

File "/usr/lib/python2.7/site-packages/usb1/libusb1.py", line 173, in _loadLibrary

return dll_loader('libusb-1.0' + suffix, **loader_kw)

File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__

self._handle = _dlopen(self._name, mode)

OSError: /lib/libusb-1.0.so: file too short

idata
Community Manager
53 Views

Hello ChiChi,

 

 

I find that issue very strange, I just reflashed my SD with a fresh image (I'm using the latest image iot-devkit-prof-dev-image-galileo-20160525) and tried installing the packages again and I was able to import the nfc library without trouble.

 

 

Have you tried reflashing your image?

 

 

Let me know.

 

Pedro M.
Reply