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
Parents
  • Hi,

    I tried this just now on a 10.11.4 OS X Mactop using Python 2.7.10.

    On my Mac I had to install pip as it was not installed, the pipinstaller also installs setup tools for me. I followed the instructions on this link.

    Then I installed nrfutil by using pip install nrfutil.

    I had to sudo when installing pip and also when installing nrfutil, probably because of a local setting.

    As a side note, I've found that whenever you are able to install anything using pip it will make your life infinitely easier. Simply put pip fixes the problems that I usually make for myself when installing tools, wrong paths etc.

    Best regards,

    Øyvind

  • Since OS X comes installed with python default, it will have it in the path by default as well. This means that if you update python you also need to make sure that the path updates. To find out which version of python is in the path you can run python -V.

    I've been looking a bit more into this, bear with me, this is going to be a little "hacky". Note I am still not sure why this fails for you, but this workaround should work.

    First off we will download the 0.5 branch of nrfutil (Turns out that the live branch is for a future SDK 12) direct link to zip here.

    After unzipping we need to install it, first we need to fix the dependencies, opening the requirements.txt file we find that we need to install the following:

    pip install pyserial
    pip install enum34
    pip install click
    pip install ecdsa
    pip install behave
    pip install py2exe
    

    After installing the dependencies you should be able to run the installer from the unzip location, eg. "[MY UNZIP LOCATION]\pc-nrfutil-0_5_1"

    python setup.py install
    

    The neat trick here is that the python script will run "uncompiled" so we can run main without wrappers, navigate to the nordicsemi folder and run main.py

    cd nordicsemi\
    python __main__.py
    

    For all intents and purposes this main.py is the same as nrfutil.

    Let me know if this works, or you find a better solution.

    Best regards,

    Øyvind

Reply
  • Since OS X comes installed with python default, it will have it in the path by default as well. This means that if you update python you also need to make sure that the path updates. To find out which version of python is in the path you can run python -V.

    I've been looking a bit more into this, bear with me, this is going to be a little "hacky". Note I am still not sure why this fails for you, but this workaround should work.

    First off we will download the 0.5 branch of nrfutil (Turns out that the live branch is for a future SDK 12) direct link to zip here.

    After unzipping we need to install it, first we need to fix the dependencies, opening the requirements.txt file we find that we need to install the following:

    pip install pyserial
    pip install enum34
    pip install click
    pip install ecdsa
    pip install behave
    pip install py2exe
    

    After installing the dependencies you should be able to run the installer from the unzip location, eg. "[MY UNZIP LOCATION]\pc-nrfutil-0_5_1"

    python setup.py install
    

    The neat trick here is that the python script will run "uncompiled" so we can run main without wrappers, navigate to the nordicsemi folder and run main.py

    cd nordicsemi\
    python __main__.py
    

    For all intents and purposes this main.py is the same as nrfutil.

    Let me know if this works, or you find a better solution.

    Best regards,

    Øyvind

Children
No Data
Related