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

nrfutil on OSX Big Sur fails to execute: symbol not found

Hello,

Updating developer machines to OSX Big Sur resulted in nrfutil failing to execute. The install via pip works correctly, but when attempting to run the binary, the following happens:

➜ nrfutil
Traceback (most recent call last):
File "/usr/local/bin/nrfutil", line 5, in <module>
from nordicsemi.__main__ import cli
File "/usr/local/lib/python3.9/site-packages/nordicsemi/__main__.py", line 53, in <module>
from nordicsemi.dfu.dfu_transport_serial import DfuTransportSerial
File "/usr/local/lib/python3.9/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 52, in <module>
from nordicsemi.lister.device_lister import DeviceLister
File "/usr/local/lib/python3.9/site-packages/nordicsemi/lister/device_lister.py", line 40, in <module>
from nordicsemi.lister.unix.unix_lister import UnixLister
File "/usr/local/lib/python3.9/site-packages/nordicsemi/lister/unix/unix_lister.py", line 43, in <module>
import serial.tools.list_ports
File "/usr/local/lib/python3.9/site-packages/serial/tools/list_ports.py", line 29, in <module>
from serial.tools.list_ports_posix import comports
File "/usr/local/lib/python3.9/site-packages/serial/tools/list_ports_posix.py", line 31, in <module>
from serial.tools.list_ports_osx import comports
File "/usr/local/lib/python3.9/site-packages/serial/tools/list_ports_osx.py", line 32, in <module>
kIOMasterPortDefault = ctypes.c_void_p.in_dll(iokit, "kIOMasterPortDefault")
ValueError: dlsym(RTLD_DEFAULT, kIOMasterPortDefault): symbol not found

Parents
  • Hello,

    There have been some reports of compatibility issues with Python v3.9 and nrfutil that we have not been able to resolve yet (e..g this post: https://devzone.nordicsemi.com/f/nordic-q-a/67790/pc-ble-driver-py-on-mac-importerror-image-not-found ) Could you please try with v.3.8.6 from python.org and see if you get the same result? And sorry for the inconvenience.

  • Thank you for the prompt reply. I'm seeing the following:

    ERROR: Could not find a version that satisfies the requirement pc_ble_driver_py>=0.14.2 (from nrfutil) (from versions: 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.11.4)
    ERROR: No matching distribution found for pc_ble_driver_py>=0.14.2 (from nrfutil)

    I've updated pip and tried multiple times, according to some other questions I've seen answered, but it's still not working. Any ideas?

  • It looks like maybe Python 2.x is used because pip is listing all the old versions of the pc_ble_driver_py package that didn't have Python 3 support (pc_ble_driver_py>=0.14.2 requires python3).

    To ensure it's installed with the correct python version, please try to install it like this:

    $ /usr/local/bin/python3 -m pip install --user  nrfutil

  • I'm sorry. I forgot to mention that I'm using pyenv. I can definitely see that Python 3 is being used. I ran the command you gave but modified for my pyenv install. Same issue:

    ➜ /Users/USER_DIR/.pyenv/versions/3.8.6/bin/python3.8 -m pip install --user  nrfutil
    Collecting nrfutil
      Using cached nrfutil-6.1.0.tar.gz (842 kB)
    Collecting click
      Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
    Collecting crcmod
      Using cached crcmod-1.7.tar.gz (89 kB)
    Collecting ecdsa
      Using cached ecdsa-0.16.1-py2.py3-none-any.whl (104 kB)
    Collecting intelhex
      Using cached intelhex-2.3.0-py2.py3-none-any.whl (50 kB)
    Collecting libusb1
      Using cached libusb1-1.8.tar.gz (78 kB)
    ERROR: Could not find a version that satisfies the requirement pc_ble_driver_py>=0.14.2 (from nrfutil) (from versions: 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.11.4)
    ERROR: No matching distribution found for pc_ble_driver_py>=0.14.2 (from nrfutil)

  • Unfortunately, I have not managed to replicate this here. I just upgraded to Big Sur. Here's how I did it:

    vidar$ /usr/local/bin/python3 -m venv venv
    vidar$ source ./venv/bin/activate
    (venv) vidar$ which python
    /Users/vidar/Nordic/pc-nrfutil/venv/bin/python
    (venv) vidar$ python -V
    Python 3.8.6
    (venv) vidar$ pip install -U pip
    Collecting pip
      Using cached pip-20.2.4-py2.py3-none-any.whl (1.5 MB)
    Installing collected packages: pip
      Attempting uninstall: pip
        Found existing installation: pip 20.2.1
        Uninstalling pip-20.2.1:
          Successfully uninstalled pip-20.2.1
    Successfully installed pip-20.2.4
    (venv) vidar$ pip install nrfutil
    Collecting nrfutil
      Downloading nrfutil-6.1.0.tar.gz (842 kB)
         |████████████████████████████████| 842 kB 1.3 MB/s 
    Collecting click
      Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
         |████████████████████████████████| 82 kB 1.6 MB/s 
    Collecting crcmod
      Using cached crcmod-1.7.tar.gz (89 kB)
    Collecting ecdsa
      Downloading ecdsa-0.16.1-py2.py3-none-any.whl (104 kB)
         |████████████████████████████████| 104 kB 4.3 MB/s 
    Collecting intelhex
      Downloading intelhex-2.3.0-py2.py3-none-any.whl (50 kB)
         |████████████████████████████████| 50 kB 8.7 MB/s 
    Collecting libusb1
      Downloading libusb1-1.8.tar.gz (78 kB)
         |████████████████████████████████| 78 kB 8.1 MB/s 
    Collecting pc_ble_driver_py>=0.14.2
      Using cached pc_ble_driver_py-0.15.0-cp38-cp38-macosx_10_9_x86_64.whl (2.3 MB)
    Collecting piccata
      Using cached piccata-2.0.1-py3-none-any.whl (21 kB)
    Collecting protobuf
      Downloading protobuf-3.14.0-cp38-cp38-macosx_10_9_x86_64.whl (1.0 MB)
         |████████████████████████████████| 1.0 MB 3.9 MB/s 
    Collecting pyserial
      Using cached pyserial-3.4-py2.py3-none-any.whl (193 kB)
    Collecting pyspinel>=1.0.0a3
      Using cached pyspinel-1.0.1-py3-none-any.whl (69 kB)
    Collecting pyyaml
      Downloading PyYAML-5.3.1.tar.gz (269 kB)
         |████████████████████████████████| 269 kB 11.2 MB/s 
    Collecting tqdm
      Downloading tqdm-4.52.0-py2.py3-none-any.whl (71 kB)
         |████████████████████████████████| 71 kB 4.8 MB/s 
    Collecting six>=1.9.0
      Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
    Collecting wrapt
      Using cached wrapt-1.12.1.tar.gz (27 kB)
    Collecting ipaddress
      Using cached ipaddress-1.0.23-py2.py3-none-any.whl (18 kB)
    Using legacy 'setup.py install' for nrfutil, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for crcmod, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for libusb1, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for pyyaml, since package 'wheel' is not installed.
    Using legacy 'setup.py install' for wrapt, since package 'wheel' is not installed.
    Installing collected packages: click, crcmod, six, ecdsa, intelhex, libusb1, wrapt, pc-ble-driver-py, piccata, protobuf, pyserial, ipaddress, pyspinel, pyyaml, tqdm, nrfutil
        Running setup.py install for crcmod ... done
        Running setup.py install for libusb1 ... done
        Running setup.py install for wrapt ... done
        Running setup.py install for pyyaml ... done
        Running setup.py install for nrfutil ... done
    Successfully installed click-7.1.2 crcmod-1.7 ecdsa-0.16.1 intelhex-2.3.0 ipaddress-1.0.23 libusb1-1.8 nrfutil-6.1.0 pc-ble-driver-py-0.15.0 piccata-2.0.1 protobuf-3.14.0 pyserial-3.4 pyspinel-1.0.1 pyyaml-5.3.1 six-1.15.0 tqdm-4.52.0 wrapt-1.12.1
    
    

    Maybe you could try download and install the pc_ble_driver_py-0.15.0-cp38-cp38-macosx_10_9_x86_64.whl package manually (https://pypi.org/project/pc-ble-driver-py/#files)?

  • I assume it's just an issue on my end and I will troubleshoot. Thank you for your help. I appreciate it.

  • No problem. Let me know if there's anything else I can do to help troubleshoot this.

Reply Children
No Data
Related