This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

driver = BLEDriver( NameError: name 'BLEDriver' is not defined

I am trying to run the heart_rate_collector.py example in Nordic's pc_ble_driver_py library. When I try to execute the program, I get the following error:

Command used to run example:

(I have also tried running with python instead of python3)

I have modified the code in two places:

  • main function starting on Line 166 now reads:
  • Line 216 now reads:

Things I have tried to resolve this issue:

  • Uninstalling Python3.9, and installing Python3.8.8
  • I have tried using different serial ports on my computer

The issue still exists.

Additionally, I am using a Mac, and have followed instructions here to properly disable MSD. I am able to verify that the board connects successfully via the serial port by opening nRF Connect and selecting the device.

My system Information:

OS: macOS Big Sur version 11.2.1

Python version 3.8.8

Connectivity firmware version: 4.2.1

SoftDevice API version 5

What am I unable to execute the pc_ble_driver_py example?

Please let me know if I can offer any additional information to help resolve this issue.

  • Hi,

    Did you install pc-ble-driver-py through pip, or are you running the example without installing? Have you made sure that it is installed for the same version of python that you are using to run the example?

    Best regards,
    Jørgen

  • Hi Jorgen,

    Yes, I have installed pc-ble-driver-py through pip, and can verify:

  • Hi Jorgen,

    Have you been able to dig into this issue any further? I am still looking for a path forward using the pc-ble-driver-py with a mac...

    Best,

    Elaine

  • Unfortunately, I have not been able to run pc-ble-driver-py on macOS Big Sur. From the date of the pc-ble-driver-py release, it appears that is have not been tested on Big Sur.

    How have you installed Python on your macOS (Homebrew, pyenv, etc)? Are you running the application from another location than where pip installs the package (site-packages)? Could you try to run the example directly from the location where it is installed (see "Location" under "pip show pc-ble-driver-py")?

  • Yes, as I replied above, I have installed Python on my computer. I am running the application in PyCharm, with the interpreter pointing to the python 3 installation (there is only one in my system).

    I am trying to use the pc-ble-driver-py with Windows now. Still running into issues.

1 2