Error importing lightblue

Bug #224003 reported by Rodrigo Vieira Couto
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-lightblue (Debian)
Fix Released
Unknown
python-lightblue (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: python-lightblue

When I import the lightblue module the following error occurs:

rodrigo@rodrigo-desk:~$ python
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lightblue
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/lib/python-support/python2.5/lightblue/__init__.py", line 163, in <module>
    from _lightblue import *
  File "/var/lib/python-support/python2.5/lightblue/_lightblue.py", line 29, in <module>
    "cannot find PyBluez 'bluetooth' module: " + str(e))
ImportError: LightBlue requires PyBluez to be installed, cannot find PyBluez 'bluetooth' module: No module named _bluetooth

I think this is a dependency problem, since the LightBlue homepage (http://lightblue.sourceforge.net/#downloads) says that PyBluez and OpenObex are required.

Ubuntu release:
rodrigo@rodrigo-desk:~$ lsb_release -rd
Description: Ubuntu 8.04
Release: 8.04

python-lightblue version:
rodrigo@rodrigo-desk:~$ apt-cache policy python-lightblue
python-lightblue:
  Instalado: 0.2-3
  Candidato: 0.2-3
  Tabela de versão:
 *** 0.2-3 0
        500 http://br.archive.ubuntu.com hardy/universe Packages
        100 /var/lib/dpkg/status

Revision history for this message
June Tate-Gans (june) wrote :

I can confirm that even after installing python-pybluez and attempting to import lightblue, I get the same error still. It's more than a dependency problem at this point -- python-lightblue is actually /broken/.

kryten:~$ dpkg --list |grep bluez
ii bluez-audio 3.26-0ubuntu6 Bluetooth audio support
ii bluez-cups 3.26-0ubuntu6 Bluetooth printer driver for CUPS
ii bluez-gnome 0.25-0ubuntu1 Bluetooth utilities for GNOME
ii bluez-utils 3.26-0ubuntu6 Bluetooth tools and daemons
ii python-bluez 0.14-1ubuntu1 Python wrappers around BlueZ for rapid bluetooth
kryten:~$ python
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lightblue
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/lib/python-support/python2.5/lightblue/__init__.py", line 163, in <module>
    from _lightblue import *
  File "/var/lib/python-support/python2.5/lightblue/_lightblue.py", line 29, in <module>
    "cannot find PyBluez 'bluetooth' module: " + str(e))
ImportError: LightBlue requires PyBluez to be installed, cannot find PyBluez 'bluetooth' module: No module named _bluetooth

Ubuntu release:
kryten:~$ lsb_release -rd
Description: Ubuntu 8.04
Release: 8.04

python-lightblue version:
kryten:~$ apt-cache policy python-lightblue
python-lightblue:
  Installed: 0.2-3
  Candidate: 0.2-3
  Version table:
 *** 0.2-3 0
        500 http://uk.archive.ubuntu.com hardy/universe Packages
        100 /var/lib/dpkg/status

python-bluez version:
kryten:~$ apt-cache policy python-bluez
python-bluez:
  Installed: 0.14-1ubuntu1
  Candidate: 0.14-1ubuntu1
  Version table:
 *** 0.14-1ubuntu1 0
        500 http://uk.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
June Tate-Gans (june) wrote :

This problem can be fixed by simply fixing all references to "_bluetooth" with "bluetooth._bluetooth". I've attached a patch that solves the problem (the offending file is simply the _lightblue.py file).

Please note, that the version of python-lightblue included in Ubuntu 8.04 is very old at this point, and too old for the python-bluez module included in Hardy. Current version in Hardy is 0.2-3 while upstream is at 0.3.2. I've confirmed that the upstream version fixes the problem by pulling down the source from their site, recompiling, and testing an OBEX connection.

it would be preferable to simply update the package with the upstream version if at all possible, rather than applying the attached patch, as much functionality is missing between the existing version and upstream.

Revision history for this message
June Tate-Gans (june) wrote :

Additionally confirmed that 0.3.2 exists in Debian testing and unstable.

Revision history for this message
Federico Sassi (fsassi) wrote :

Everything confirmed even on a system upgraded from 7.10

Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

Similar problems on 8.04. Additionally. the package doesn't seem to declare its dependency on python-bluez.

Changed in python-lightblue:
status: New → Confirmed
Revision history for this message
Thiago Teixeira (tvst) wrote :

This is still going on with 9.04 . The solution, of course, is just to install python-bluez. But it should be marked as a dependency by the package maintainers.

Revision history for this message
David Futcher (bobbo) wrote :

I am marking the patch attached above (comment #2) as rejected as it seems we can solve this just by include python-bluez as a dependency. If this is wrong, please comment!

A bug report for this has been filed in Debian and we will hopefully see it coming downstream soon. However, if it's still sitting here in a few months, I'll create a delta and include it in Ubuntu.

Thanks!

tags: added: patch-rejected
Changed in python-lightblue (Debian):
status: Unknown → New
Changed in python-lightblue (Debian):
status: New → Fix Released
Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

This bug was fixed in the package python-lightblue - 0.3.2-2

---------------
python-lightblue (0.3.2-2) unstable; urgency=medium

  * QA upload.
  * Set QA Group as Maintainer.
  * Add missing dependency on pybluez (Closes: #562907).
  * python-support is deprecated. Port to dh_python2 and dh.
  * Bump Standards-Version to 3.9.6

 -- Andrew Starr-Bochicchio <email address hidden> Wed, 26 Nov 2014 20:24:35 -0500

Changed in python-lightblue (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.