Hi,
I have installed nrfutil on my Windows 10 computer and get the following error when running it:
C:\Users\00315055>nrfutil --helpTraceback (most recent call last): File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Python37\Scripts\nrfutil.exe\__main__.py", line 5, in <module> File "c:\python37\lib\site-packages\nordicsemi\__main__.py", line 53, in <module> from nordicsemi.dfu.dfu_transport_serial import DfuTransportSerial File "c:\python37\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 52, in <module> from nordicsemi.lister.device_lister import DeviceLister File "c:\python37\lib\site-packages\nordicsemi\lister\device_lister.py", line 39, in <module> from nordicsemi.lister.windows.lister_win32 import Win32Lister File "c:\python37\lib\site-packages\nordicsemi\lister\windows\lister_win32.py", line 43, in <module> from constants import DIGCF_PRESENT, DEVPKEY, DIGCF_DEVICEINTERFACEModuleNotFoundError: No module named 'constants'
I have the following Python version:
C:\Users\00315055>python --versionPython 3.7.4
BR / Björn
Final update:
1) I uninstalled components (it has nothing to do with nrfutil):
pip uninstall components
2) I uninstalled nrfutil:
3) I installed latest version of nrfutil:
pip…
Fixed by downgrading to Python 3.8.6 and pip 20.1.1
Yes, it is unfortunate. The current nrfutil release was made before Python 3.9, hence not included in our release tests. I have already reported this to the team, so it should get fixed in the next…
Helllo Bjorn,
i have the exact same issue as you had. But in my case your solution does not work. I cant get nrfutil to function properly.
ImportError: cannot import name 'DIGCF_PRESENT' from 'constants' (c:\python37\lib\site-packages\constants.py)
This error does still appear.
Please help.
Python 3.9.0
Hi A Wagner,
Today I installed Python and nrfutil on a new computer. I installed Python 3.9.1 and then nrfutil through pip. I had the same issue as originally reported here, so it seems nrfutil does not work with Python 3.9.x. I downgraded Python to 3.7 and then nrfutil worked again.
Nordic should fix this issue, very irritating when you download something from scratch that crashes first thing :-(
Yes, it is unfortunate. The current nrfutil release was made before Python 3.9, hence not included in our release tests. I have already reported this to the team, so it should get fixed in the next version.
Best regards,
Vidar
Thanks Vidar, great that you have a fix in your plans :-)
Merry XMAS!
Hmm, I have a fresh install with 3.8.7 and I see the same error:
ImportError: cannot import name 'DIGCF_PRESENT' from 'constants' (c:\users\someone\appdata\local\programs\python\python38\lib\site-packages\constants.py)
This is a bummer since I need to test secure DFU for a client.
I am not sure if v3.8.7 has been tested. Is it an option to use the pre-buildt executables here: https://github.com/NordicSemiconductor/pc-nrfutil/releases ?
Any update to this? Still getting this error today.
We have been installing several new machines recently and all of them are now using Python3.8 as 3.9 still does not work as per my comment devzone.nordicsemi.com/.../320752
This is valid for Windows 10 only though as all is working dandy on Mac over here.