bensonsearch
Posts: 15
Joined: Thu May 30, 2013 1:23 am

bluetooth import

Thu May 30, 2013 1:28 am

Hi All,

im super new to python and my little raspberry pi (i normally use vb.net so not new to programming as a whole).

I have installed a usb bluetooth dongle and it all works fine from the command line as it should and it installed bluez as well.

in python i have

Code: Select all

import bluetooth
and also tried

Code: Select all

from bluetooth import *
both error saying
Traceback (most recent call last):
File "/home/pi/test.py", line 1, in <module>
from bluetooth import *
ImportError: No module named bluetooth


please help

bushrat
Posts: 69
Joined: Mon Mar 05, 2012 8:35 pm

Re: bluetooth import

Thu May 30, 2013 2:05 am

How did you install BlueZ? Like this:

Code: Select all

sudo apt-get install bluetooth
If so, and I know it's a real cliche by now, try turning your Pi off and on again, you never know :)

bensonsearch
Posts: 15
Joined: Thu May 30, 2013 1:23 am

Re: bluetooth import

Thu May 30, 2013 2:17 am

Hi,
Thank you so much for the reply.

It installed as part of the adaptor install, I know this as I tried

Code: Select all

sudo apt-get install bluez
and it returned saying already installed

however i fixed the error since by

Code: Select all

sudo apt-get install python-bluez
fixed the issue :)

thanx again so much

Return to “Python”