Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyBluez question
#1
Hi,

I am attempting to connect various devices with my Pi 3 / python 3, via bluetooth.
Installed pyBluez etc... but upon running a simple detection/pairing program,
i keep getting the error:
undefined symbol: pyString_fromStringAndSize.

After extensive searching, this seems to be a Python 2 <> 3 thing,
but i cannot find a single straightforward fix.

Any suggestions?
thx,
Paul

import bluetooth

target_name = "HP-PDA"
target_address = None

nearby_devices = bluetooth.discover_devices()

for bdaddr in nearby_devices:
    if target_name == bluetooth.lookup_name( bdaddr ):
        target_address = bdaddr
        break

if target_address is not None:
    print("found target bluetooth device with address ", target_address)
else:
    print("could not find target bluetooth device nearby")
Traceback (most recent call last):
File "/home/pi/bluetooth/blueFinder.py", line 1, in <module>
import bluetooth
File "/usr/local/lib/python3.5/dist-packages/bluetooth/__init__.py", line 45, in <module>
from bluetooth.bluez import *
File "/usr/local/lib/python3.5/dist-packages/bluetooth/bluez.py", line 10, in <module>
import bluetooth._bluetooth as _bt
ImportError: /usr/local/lib/python3.5/dist-packages/bluetooth/_bluetooth.so: undefined symbol: PyString_FromStringAndSize
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020