ImportError: No module named usb

870 views
Skip to first unread message

Alikazam

unread,
Jul 16, 2011, 3:39:46 AM7/16/11
to pywws
I wonder if anybody can help. I am trying to install pywws on my Qnap
ts210. I have installed python25 using qpkg and then installed libusb
0.1.12-2 and py25-usb 0.4.1-1 using ipkg.

When I run TestWeatherStation.py I get the message ImportError: no
module named usb.

I have read on this forum that this is likely a problem with py25-usb
not being installed properly. I have removed and then reinstalled py25-
usb and get the same error. I originally had py-usb installed but
removed this and replaced it with py25-usb as recommended on another
post.

I've run out of ideas!

Ali

Jim Easterbrook

unread,
Jul 16, 2011, 5:39:47 AM7/16/11
to py...@googlegroups.com

I think the clue is that you used qpkg to install python25 and ipkg to
install py25-usb. I suspect ipkg has installed the py25-usb modules
somewhere not on python's search path. You can test this by seeing where
each package thinks the 'site-packages' directory is:

qpkg files python25 | grep site

ipkg files py25-usb | grep site

If this is the answer, you can add the ipkg site-package directory to
your python installation's search path, as described here:
http://docs.python.org/install/index.html#inst-search-path
or you could uninstall the qpkg python25 and install the ipkg one
instead. This might be a better solution as there are less likely to be
incompatibilities between modules and the python interpreter.
--
Jim Easterbrook <http://www.jim-easterbrook.me.uk/>

Alastair Hallsworth

unread,
Jul 16, 2011, 5:53:07 AM7/16/11
to py...@googlegroups.com
Great advice - I took the second option and removed the qpkg version, then installed with ipkg. Must be making progress because I get a different error message!

[/opt/bin/pywws-11.05_r380] # python TestWeatherStation.py                                                 
Traceback (most recent call last):
  File "TestWeatherStation.py", line 119, in <module>
    sys.exit(main())
  File "TestWeatherStation.py", line 71, in main
    ws = WeatherStation.weather_station(ws_type=ws_type)
  File "/share/MD0_DATA/.qpkg/Optware/bin/pywws-11.05_r380/pywws/WeatherStation.py", line 234, in __init__
    self.devh.setConfiguration(1)
usb.USBError: could not set config 1: Device or resource busy
Exception exceptions.ValueError: ValueError('No interface claimed',) in <bound method weather_station.__del__ of <pywws.WeatherStation.weather_station object at 0x405f8bd0>> ignored

Any ideas? I will search through the group for any similar problems.

Thanks for your help.
Ali



--
You received this message because you are subscribed to the Google Groups "pywws" group.
To post to this group, send email to py...@googlegroups.com.
To unsubscribe from this group, send email to pywws+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pywws?hl=en.


felixs

unread,
Aug 4, 2011, 4:32:31 AM8/4/11
to pywws
Hello,

I had the same problem with a "Allnet" NAS.
Many tests later and with help from an other forum I got the
information,
that Kernel 2.4.xx this usb software (driver for weatherstation) not
supported.
Kernel 2.6.xx and higher have no problem with this. Mayby you have the
same problem.

felix

Reply all
Reply to author
Forward
0 new messages