nrfutil ModuleNotFoundError: No module named 'constants'

Hi,

I have installed nrfutil on my Windows 10 computer and get the following error when running it:

C:\Users\00315055>nrfutil --help
Traceback (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_DEVICEINTERFACE
ModuleNotFoundError: No module named 'constants'

I have the following Python version:

C:\Users\00315055>python --version
Python 3.7.4

BR / Björn

Parents
  • An update:

    I installed the module called constants, but now I get another error:

    C:\Users\00315055>pip install constants
    Collecting constants
    Downloading files.pythonhosted.org/.../constants-0.6.0.tar.gz
    Building 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\7e051dae7d8fb9db1c04b0fe309a8bea40111080d3b62f1ca9
    Successfully built constants
    Installing collected packages: constants
    Successfully installed constants-0.6.0
    You 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 --help
    Traceback (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_DEVICEINTERFACE
    ImportError: 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!

  • Final update:

    1) I uninstalled components (it has nothing to do with nrfutil):

    pip uninstall components

    2) I uninstalled nrfutil:

    pip uninstall components

    3) I installed latest version of nrfutil:

    pip install nrfutil

    Now it works. Case closed!

    BR / Björn

Reply Children
No Data
Related