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

nrfutil on OSX

Hi all,

I'm on 10.11.1 (El Capitan), followed the instructions here

github.com/.../pc-nrfutil

And it looks like installed was happy but when I try and run nrfutil it crashes immediately

nrfutil --help Fatal Python error: PyThreadState_Get: no current thread Abort trap: 6 Chriss-MacBook-Pro:pc-nrfutil-master christopher$

Anyone successfully installed this lately?

Bit more info

Chriss-MacBook-Pro:Downloads christopher$ sudo -H pip install nrfutil
Collecting nrfutil
  Downloading nrfutil-1.3.0.zip (89kB)
    100% |████████████████████████████████| 92kB 1.1MB/s 
Requirement already satisfied (use --upgrade to upgrade): pyserial>=2.7 in /usr/local/lib/python2.7/site-packages/pyserial-3.1.1-py2.7.egg (from nrfutil)
Requirement already satisfied (use --upgrade to upgrade): enum34>=1.0.4 in /usr/local/lib/python2.7/site-packages/enum34-1.1.6-py2.7.egg (from nrfutil)
Requirement already satisfied (use --upgrade to upgrade): click in /usr/local/lib/python2.7/site-packages/click-6.6-py2.7.egg (from nrfutil)
Requirement already satisfied (use --upgrade to upgrade): ecdsa>=0.13 in /usr/local/lib/python2.7/site-packages/ecdsa-0.13-py2.7.egg (from nrfutil)
Requirement already satisfied (use --upgrade to upgrade): behave in /usr/local/lib/python2.7/site-packages/behave-1.2.5-py2.7.egg (from nrfutil)
Requirement already satisfied (use --upgrade to upgrade): protobuf in /usr/local/lib/python2.7/site-packages/protobuf-3.0.0b4-py2.7.egg (from nrfutil)
Requirement already satisfied (use --upgrade to upgrade): pc_ble_driver_py>=0.5.0 in /usr/local/lib/python2.7/site-packages/pc_ble_driver_py-0.5.0-py2.7.egg (from nrfutil)
Requirement already satisfied (use --upgrade to upgrade): parse>=1.6.3 in /usr/local/lib/python2.7/site-packages/parse-1.6.6-py2.7.egg (from behave->nrfutil)
Requirement already satisfied (use --upgrade to upgrade): parse_type>=0.3.4 in /usr/local/lib/python2.7/site-packages/parse_type-0.3.4-py2.7.egg (from behave->nrfutil)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/site-packages (from behave->nrfutil)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/local/lib/python2.7/site-packages (from protobuf->nrfutil)
Requirement already satisfied (use --upgrade to upgrade): wrapt in /usr/local/lib/python2.7/site-packages/wrapt-1.10.8-py2.7-macosx-10.10-x86_64.egg (from pc_ble_driver_py>=0.5.0->nrfutil)
Requirement already satisfied (use --upgrade to upgrade): future in /usr/local/lib/python2.7/site-packages/future-0.15.2-py2.7.egg (from pc_ble_driver_py>=0.5.0->nrfutil)
Building wheels for collected packages: nrfutil
  Running setup.py bdist_wheel for nrfutil ... done
  Stored in directory: /var/root/Library/Caches/pip/wheels/8f/7e/75/60b89ebdf8ad43a43d653e910558023262d33aba163c4b2b3c
Successfully built nrfutil
Installing collected packages: nrfutil
Successfully installed nrfutil-1.3.0
Chriss-MacBook-Pro:Downloads christopher$ nrfutil
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
  • I tried the same installation on my Mac 10.12 (Sierra), and I get exactly the same issue.

    Did you manage to fix the problem?

    Edit: I finally try to use an older version 0.5.1 from the github and it seems to works correctly.

  • If you have non-system python installed (via brew or macports) you can try suggestion from github.com/.../47

    here are commands that fixed that for me

    after pip install pc_ble_driver_py

    I ran

    sudo install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib /usr/local/lib/python2.7/site-packages/pc_ble_driver_py/lib/macos_osx/_pc_ble_driver_sd_api_v3.so
    
    sudo install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib /usr/local/lib/python2.7/site-packages/pc_ble_driver_py/lib/macos_osx/_pc_ble_driver_sd_api_v2.so
    
Related