0

I try to execute the file 'pbapclient.py'. I downloaded the files from https://github.com/bmwcarit/pypbap , but the console prompt show me some errors. I want to print/save all my contact from my android phone(I've got htc one m9).I run antergos. I try for at least 4 month... thanks for the help. This is the prompt

[mattia@LinuxMattia pypbap-master]$ python3 pbapclient.py 
Traceback (most recent call last): File "pbapclient.py", line 22, in 
<module> from PyOBEX import client File "/usr/lib/python3.7/site- 
packages/PyOBEX/client.py", line 489, in <module>
class SyncClient(Client): File "/usr/lib/python3.7/site- 
packages/PyOBEX/client.py", line 491, in SyncClient
def connect(self, header_list = (headers.Target("IRMC-SYNC"),)):
File "/usr/lib/python3.7/site-packages/PyOBEX/headers.py", line 33, in 
__init__
self.data = self.encode(data)
File "/usr/lib/python3.7/site-packages/PyOBEX/headers.py", line 48, in 
encode return struct.pack(">BH", self.code, len(data) + 3) + data
TypeError: can't concat str to bytes

Thanks for the help

1 Answers1

0

The installation guide (https://github.com/bmwcarit/pypbap#installation) tells you that the program needs to be run with python2, however you were using python3.

Robsdedude
  • 1,292
  • 16
  • 25
  • I tried. Show me " ImportError: No modulo James bluetooth" – Mattia Mazzotta Sep 01 '18 at 11:26
  • Seems like you have to install the module then. Did you run all the commands listed in the installation guide? If so: without errors? – Robsdedude Sep 01 '18 at 11:33
  • Yes I run it without any error...I don't know why it's not working – Mattia Mazzotta Sep 01 '18 at 11:47
  • Try `pip freeze | grep pybluez`. If nothing is returned you're missing the module. In that case see if you can install it through you're package manager (yum, apt, pacman, …). If it returns `pybluez==0.22`, you should open a new question including the stack trace and everything. – Robsdedude Sep 01 '18 at 15:58