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…
An update:
I installed the module called constants, but now I get another error:
C:\Users\00315055>pip install constantsCollecting constants Downloading files.pythonhosted.org/.../constants-0.6.0.tar.gzBuilding wheels for collected packages: constants Building wheel for constants (setup.py) ... done Stored in directory: C:\Users\00315055\AppData\Local\pip\Cache\wheels\75\a1\25\7e051dae7d8fb9db1c04b0fe309a8bea40111080d3b62f1ca9Successfully built constantsInstalling collected packages: constantsSuccessfully installed constants-0.6.0You are using pip version 19.0.3, however version 20.2.3 is available.You should consider upgrading via the 'python -m pip install --upgrade pip' command.
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_DEVICEINTERFACEImportError: cannot import name 'DIGCF_PRESENT' from 'constants' (c:\python37\lib\site-packages\constants.py)
So now it finds the module, but not the name 'DIGCF_PRESENT' in the module.
Please advise!
pip install nrfutil
Now it works. Case closed!