Issue with Flashing using nRF Connect Exentions in VS Code

Hi there,

I'm encountering an issue while trying to flash a PWM example built with NCS v2.9.0 on Windows 11 (using Python 3.10). The build completes successfully and generates the merged.hex file, but flashing fails with a Python DLL conflict error. Here's the relevant output:

pgsql
CopyEdit
-- west flash: using runner nrfutil -- runners.nrfutil: Flashing file: merged.hex Traceback (most recent call last): File "runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "runpy.py", line 86, in _run_code exec(code, run_globals) File "nrfutil.exe\__main__.py", line 4, in <module> File "site-packages\nordicsemi\__main__.py", line 43, in <module> import click File "site-packages\click\__init__.py", line 7, in <module> from .core import Argument as Argument File "site-packages\click\core.py", line 16, in <module> from . import types File "site-packages\click\types.py", line 8, in <module> from ._compat import _get_argv_encoding File "site-packages\click\_compat.py", line 518, in <module> from ._winconsole import _get_windows_console_stream File "site-packages\click\_winconsole.py", line 13, in <module> from ctypes import byref File "ctypes\__init__.py", line 8, in <module> from _ctypes import Union, Structure, Array ImportError: Module use of python312.dll conflicts with this version of Python.

What I've tried so far:

  1. Reinstalled the toolchain, SDK, VS Code extensions, and VS Code itself.
  2. Installed and uninstalled Python 3.12.
  3. Used the nRF Connect Desktop Programmer, which successfully flashed the board.
  4. Verified nrfutil version: 7.13.0

It seems that nrfutil is attempting to use python312.dll, causing a conflict with my Python 3.10 setup.

Any suggestions on how to resolve this would be greatly appreciated!

Thanks!
Karim

Parents Reply
  • Hi Priyanka,
    I ran the command the output showed the path of the 2 python versions, 


    which version to unintsall ? 3.12 or 3.10 ? 
    If 3.12 is to be removed (As the nrfutil is not in its directory) then,  I face the same issue that ends with

    "  File "\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 8, in <module>
    ImportError: Module use of python312.dll conflicts with this version of Python."

    and the python312.dll is inside the toolchain bin folder

    Thanks,
    Karim Osama

Children
Related