This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

west flash fail

hello Nordic

i am using nrf52840 with zephyr ncs

unfortunatly i used this command "pamac install downgrade" at one point

since then i can not use 'west flash --erase'

the result for that command is :

augury_app git:(zh1_bist) ✗ west flash --erase                                                
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 573, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 891, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 782, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (west 0.12.0 (/home/zhershkovitch/.local/lib/python3.10/site-packages), Requirement.parse('west==0.10.1'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/west", line 33, in <module>
    sys.exit(load_entry_point('west==0.10.1', 'console_scripts', 'west')())
  File "/home/zhershkovitch/.local/lib/python3.10/site-packages/west/app/main.py", line 781, in main
    app.run(argv or sys.argv[1:])
  File "/home/zhershkovitch/.local/lib/python3.10/site-packages/west/app/main.py", line 106, in run
    self.run_command(argv)
  File "/home/zhershkovitch/.local/lib/python3.10/site-packages/west/app/main.py", line 338, in run_command
    self.run_extension(args.command, argv)
  File "/home/zhershkovitch/.local/lib/python3.10/site-packages/west/app/main.py", line 386, in run_extension
    command = self.extensions[name].factory()
  File "/home/zhershkovitch/.local/lib/python3.10/site-packages/west/commands.py", line 488, in __call__
    mod = _commands_module_from_file(self.py_file)
  File "/home/zhershkovitch/.local/lib/python3.10/site-packages/west/commands.py", line 467, in _commands_module_from_file
    spec.loader.exec_module(mod)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/zhershkovitch/workspace/ncs/zephyr/scripts/west_commands/flash.py", line 11, in <module>
    from run_common import add_parser_common, do_run_common
  File "/home/zhershkovitch/workspace/ncs/zephyr/scripts/west_commands/run_common.py", line 31, in <module>
    from runners import get_runner_cls, ZephyrBinaryRunner, MissingProgram
  File "/home/zhershkovitch/workspace/ncs/zephyr/scripts/west_commands/runners/__init__.py", line 52, in <module>
    _import_runner_module(_name)
  File "/home/zhershkovitch/workspace/ncs/zephyr/scripts/west_commands/runners/__init__.py", line 14, in _import_runner_module
    importlib.import_module(f'runners.{runner_name}')
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/zhershkovitch/workspace/ncs/zephyr/scripts/west_commands/runners/canopen_program.py", line 13, in <module>
    import canopen
  File "/home/zhershkovitch/.local/lib/python3.10/site-packages/canopen/__init__.py", line 1, in <module>
    from pkg_resources import get_distribution, DistributionNotFound
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3266, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3240, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3278, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 575, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 588, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'west==0.10.1' distribution was not found and is required by the application
➜  augury_app git:(zh1_bist) ✗ 

i have tried the following:

pip3 install --user cmake west
and in ncs directory:
 pip3 install --user -r zephyr/scripts/requirements.txt
 pip3 install --user -r nrf/scripts/requirements.txt
 pip3 install --user -r bootloader/mcuboot/scripts/requirements.txt

and still the same 

any ideas ???

hope to read from you soon 

best regards

Ziv

  • Hi,

     

    This line indicates that it is something in your system requiring this specific version of west:

    pkg_resources.DistributionNotFound: The 'west==0.10.1' distribution was not found and is required by the application

     

    Have you tried building and running other samples to see if you get the same behavior there? Could it be enough to remove your build folder and reconfigure?

     

    Kind regards,

    Håkon

  • hi 

    ok, what actually solved the issue for me was downgrading my nrfx command tool from 10.15 to 10.12.2

    i did it by downloading that version to my download dir and run the following command

    sudo pacman -U ~/Downloads/nrf5x-command-line-tools-10.12.2-2-x86_64.pkg.tar.zst

    thanks

    best regards

    Ziv

Related