esp-idf: KeyError: 'idfSelectedId' (IDFGH-8367)
Answers checklist.
- I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
- I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
IDF version.
v4.3.4
Operating System used.
macOS
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
No response
What is the expected behavior?
install all the dependency
What is the actual behavior?
KeyError: ‘idfSelectedId’
Steps to reproduce.
- macOS Ventura with Python3 download from python.org
- git clone -b v4.3.4 --recursive https://github.com/espressif/esp-idf.git esp-idf-v4.3.4
- cd esp-idf-v4.3.4
- ./install.sh
Build or installation Logs.
`magicdian@jingdiandeMBP esp-idf-v4.3.4 % ./install.sh
Detecting the Python interpreter
Checking "python" ...
/Users/magicdian/Downloads/esp-idf-v4.3.4/tools/detect_python.sh: line 16: python: command not found
Checking "python3" ...
Python 3.10.6
"python3" has been detected
Installing ESP-IDF tools
Traceback (most recent call last):
File "/Users/magicdian/Downloads/esp-idf-v4.3.4/tools/idf_tools.py", line 1852, in <module>
main(sys.argv[1:])
File "/Users/magicdian/Downloads/esp-idf-v4.3.4/tools/idf_tools.py", line 1848, in main
action_func(args)
File "/Users/magicdian/Downloads/esp-idf-v4.3.4/tools/idf_tools.py", line 1415, in action_install
targets = clean_targets(args.targets)
File "/Users/magicdian/Downloads/esp-idf-v4.3.4/tools/idf_tools.py", line 1078, in clean_targets
export_targets_to_idf_env_json(targets_from_tools_json)
File "/Users/magicdian/Downloads/esp-idf-v4.3.4/tools/idf_tools.py", line 1046, in export_targets_to_idf_env_json
targets = list(set(targets + get_user_defined_targets()))
File "/Users/magicdian/Downloads/esp-idf-v4.3.4/tools/idf_tools.py", line 1092, in get_user_defined_targets
if env == idf_env_json['idfSelectedId']:
KeyError: 'idfSelectedId'`
More Information.
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (2 by maintainers)
Commits related to this issue
- Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId' Closes https://github.com/espressif/esp-idf/issues/9837 — committed to antmak/dev-idf by deleted user 2 years ago
- Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId' Closes https://github.com/espressif/esp-idf/issues/9837 — committed to espressif/esp-idf by deleted user 2 years ago
- Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId' Closes https://github.com/espressif/esp-idf/issues/9837 — committed to espressif/esp-idf by deleted user 2 years ago
- ci: Clean-up idf-env.json which might not compatible with newer versions See https://github.com/espressif/esp-idf/issues/9837 — committed to mahavirj/esp-box by mahavirj 2 years ago
- ci: Clean-up idf-env.json which might not compatible with newer versions See https://github.com/espressif/esp-idf/issues/9837 — committed to espressif2022/esp-box by mahavirj 2 years ago
- ci: Clean-up idf-env.json which might not compatible with newer versions See https://github.com/espressif/esp-idf/issues/9837 — committed to espressif/esp-box by mahavirj 2 years ago
- Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId' Closes https://github.com/espressif/esp-idf/issues/9837 — committed to ebisuke/esp-idf by deleted user 2 years ago
- Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId' Closes https://github.com/espressif/esp-idf/issues/9837 — committed to ebisuke/esp-idf by deleted user 2 years ago
- Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId' Closes https://github.com/espressif/esp-idf/issues/9837 — committed to ebisuke/esp-idf by deleted user 2 years ago
- Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId' Closes https://github.com/espressif/esp-idf/issues/9837 — committed to ebisuke/esp-idf by deleted user 2 years ago
- Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId' Closes https://github.com/espressif/esp-idf/issues/9837 — committed to ebisuke/esp-idf by deleted user 2 years ago
- Tools: bugfix wrong format of idf-env.json, KeyError: 'idfSelectedId' Closes https://github.com/espressif/esp-idf/issues/9837 — committed to ebisuke/esp-idf by deleted user 2 years ago
just deleted the ~/.espressif folder, install.sh works! Thanks!
@AxelLin You don’t have to wait for any fix. Just remove
~/.espressif/idf-env.jsonand re-run the install script.The issue is in the
masterbranch. Switching from there to any of these release branches causes the issue. The proper fix will arrive soon to all branches. Until then, the above workaround can be used.Thanks. We will fix this soon. This will be closed by commit with a proper and permanent fix.
@Prathamesh08glovatrix it’s
/Users/<yourusername>/.espressif/idf-env.json. Running therm ~/.espressif/idf-env.jsoncommand should be enough.I believe so that the issue has been fixed if you are using an ESP-IDF with the linked patch included.
In case some of you still looking for a workaround, please be aware that removing
~/.espressif/idf-env.jsonis enough. If you remove the whole directory then all toolchains will have to be downloaded again. You don’t want that if you have slow Internet connection.I think it’s a python virtual environment issue.
How I got this error:
So, is there a quick way to switch to a new idf version of python virtual environment? For example, how to switch from idf5.1_py3.8_env to idf4.2_py3.8_env?
Hi @jdjingdian. Thanks for the report. May I ask you that have you run recently the install script for the master branch before switching to v4.3.4?
Could you please share your
~/.espressif/idf-env.jsonfile?