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

nrfutil errors on macOS

I am trying to compile nrfutil into a standalone executable, following the instructions at: https://github.com/NordicSemiconductor/pc-nrfutil

This works on Linux, and for Windows there are standalone executable attached to the nrfutil releases, but for mac I get the following error when attempting to use pyinstaller to generate a self-contained executable:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ pyinstaller ./nrfutil.spec
29 INFO: PyInstaller: 3.4
30 INFO: Python: 2.7.15
35 INFO: Platform: Darwin-17.5.0-x86_64-i386-64bit
41 INFO: UPX is not available.
42 INFO: Extending PYTHONPATH with paths
['/Users/api_team/pc-nrfutil']
42 INFO: checking Analysis
48 INFO: Building because inputs changed
48 INFO: Initializing module dependency graph...
50 INFO: Initializing module graph hooks...
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is there a specific version of pyinstaller that must be used? I have tried the instructions for nrfutil v3.5.1 and v4.0.0 with the same results. 

There is an old github issue here that has not be addressed: https://github.com/NordicSemiconductor/pc-nrfutil/issues/118

It seems from the comments on the pc-nrfutil github issues that the maintainers would prefer issues like this to be posted here on DevZone, but I will make a Github issue as well.

As a workaround I've also attempted to use pip to install nrfutil, but that fails at runtime with the following error (again with both v3.5.1 and v4.0.0):

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Starting DFU update over dfu_usb...
[------------------------------------] 0%
Traceback (most recent call last):
File "/Users/api_team/miniconda3/envs/dfu/bin/nrfutil", line 11, in <module>
sys.exit(cli())
File "/Users/api_team/miniconda3/envs/dfu/lib/python3.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Users/api_team/miniconda3/envs/dfu/lib/python3.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Users/api_team/miniconda3/envs/dfu/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

All of the above was executed in a Python 2 virtual environment.