joular / powerspycli

PowerSpyCli is a tool to connect and collect power metrics from a PowerSpy 2 powermeter.
GNU Lesser General Public License v3.0
2 stars 0 forks source link

`pybluez` install instructions #1

Closed Alystrasz closed 7 months ago

Alystrasz commented 7 months ago

I struggled to run the powerspycli script on my install (Ubuntu 23.10, Python 3.11.6) due to the pybluez dependency install instructions being somehow deprecated, so here's what I've done to make it work.


Installing pybluez through apt is not possible (package not found), I tried to install it with pip, and got the following error:

(powerspycli) remy@chimay:~/Travail/powerspycli$ pip install pybluez
Collecting pybluez
  Downloading PyBluez-0.23.tar.gz (97 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.6/97.6 kB 2.4 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      error in PyBluez setup command: use_2to3 is invalid.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

According to https://github.com/themagpimag/magpi-issue61/issues/1#issuecomment-507239119, libbluetooth-dev install is required in order to install pybluez:

sudo apt install libbluetooth-dev

pybluez install would still fail at this point:

(powerspycli) remy@chimay:~/Travail/powerspycli$ pip install pybluez
Collecting pybluez
  Using cached PyBluez-0.23.tar.gz (97 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      error in PyBluez setup command: use_2to3 is invalid.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I had to install pybluez from its repository directly:

pip install git+https://github.com/pybluez/pybluez.git#egg=pybluez
adelnoureddine commented 7 months ago

Thanks. We were using Ubuntu 20.04 so far in our classes and didn't notice the instruction aren't valid for the latest Ubuntu versions. I'll update the readme with these instructions.

Development on pybluez seems to have stopped, so we should start exploring alternatives for this script.

adelnoureddine commented 7 months ago

Updated in commit b436311