pc_ble_driver_py can't find module

I run pc_ble_driver_py example serial_port_enum.py. But it failed with can't find module error message.

python.exe .\serial_port_enum.py NRF52
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pc_ble_driver_py\lib\win\x86_64\pc_ble_driver_sd_api_v3.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 674, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 571, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1176, in create_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
ImportError: DLL load failed while importing _pc_ble_driver_sd_api_v3: 找不到指定的模組。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\workspace_Python3_Win10\pc-ble-driver-py\pc_ble_driver_py\examples\serial_port_enum.py", line 83, in <module>
    init(sys.argv[1])
  File "D:\workspace_Python3_Win10\pc-ble-driver-py\pc_ble_driver_py\examples\serial_port_enum.py", line 48, in init
    from pc_ble_driver_py.ble_driver import BLEDriver, Flasher
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pc_ble_driver_py\ble_driver.py", line 112, in <module>
    driver = importlib.import_module(SWIG_MODULE_NAME)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pc_ble_driver_py\lib\win\x86_64\pc_ble_driver_sd_api_v3.py", line 17, in <module>
    _pc_ble_driver_sd_api_v3 = swig_import_helper()
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pc_ble_driver_py\lib\win\x86_64\pc_ble_driver_sd_api_v3.py", line 16, in swig_import_helper
    return importlib.import_module('_pc_ble_driver_sd_api_v3')
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed while importing _pc_ble_driver_sd_api_v3: 找不到指定的模組。

Parents
  • Hello,

    Just so you are aware. The pc-ble-driver (and hence also the pc-ble-driver-py) is discontinued from Nordic's side. It should only be used for testing during production, and is not intended for commercial use in end products.

    Are you using an nRF52832 DK when reproducing this error?

    The first message. Does it appear immediately after you start up, or are you able to communicate with the DK for a while before the error pops up?

    I have never tested pc-ble-driver-py myself, but are you sure that you are using a supported python version? I see that it says python version >= 3.6, but since it is not maintained, perhaps python 3.10 is not supported. Can you please try python v3.7 (since that is mentioned as an example in the readme file)?

    Also, please make sure that the COM port is not in use by any other applications (any other UART terminals, for example). To make sure of this, you can disconnect and reconnect the USB cable to the DK.

    Best regards,

    Edvin

  • Thanks for your reply! Python 3.7.8 deosn't have this issue.

    D:\Python\Python37\python .\serial_port_enum.py NRF52
    enum_serial_ports: 0 serial ports found

  • Hello,

    I have never used pc-ble-driver-py myself before. Does that mean that the issue was solved? Or do you mean that it should report more than one serial port found?

    What is it supposed to say? And is there a DK connected to your computer programmed with the correct FW (the pc-ble-driver-py firmware)? If so, where did you find that FW? From the pc-ble-driver-py package, or from the nRF5 SDK?

    BR,

    Edvin

  • Python3 does not have module not found issue. But Python3 has another issue that is it can’t enumerated com port. Does pc-ble-driver-Py support nrf52840 dongle? I can use nrf52840 dongle with Nrf connect without any problems.

Reply Children
No Data
Related