I'll start that I think the issue is with the system python. Since the newest major debian release, the default system python is no longer used, and the user is forced to use pyenv. This seems to cause all sorts of issues with ESP-IDF and the python based tools.
System information
Code: Select all
# OS version
Ubuntu 22.04.3 LTS
# system python version
$ /usr/bin/python3 --version
Python 3.10.12
# global python pyenv
3.11.7/envs/primary
2. Install through vscode, selecting advanced installation and my desired installation folders (~/.espressif and ~/Documents/esp/)
3. Installation finishes. Close and open vscode.
4. Try to do anything, it fails (tools not in path)
by the way, does anyone know of a way to source the esp-idf environment on vscode startup? the way I used to do it stopped working a long time ago
5. source esp-idf environment
Code: Select all
Detecting the Python interpreter
Checking "python3" ...
Python 3.11.7
"python3" has been detected
Checking Python compatibility
Checking other ESP-IDF version.
Not using an unsupported version of tool ninja found in PATH: 1.10.1. To use it, run '/home/user/.pyenv/versions/primary/bin/python3 /home/user/Documents/esp/esp-idf/tools/idf_tools.py export --prefer-system'
Adding ESP-IDF tools to PATH...
Checking if Python packages are up to date...
ERROR: /home/user/.espressif/python_env/idf5.1_py3.11_env/bin/python doesn't exist! Please run the install script or "idf_tools.py install-python-env" in order to create it
Code: Select all
$ idf.py
Cannot import module "click". This usually means that "idf.py" was not spawned within an ESP-IDF shell environment or the python virtual environment used by "idf.py" is corrupted.
Please use idf.py only in an ESP-IDF shell environment. If problem persists, please try to install ESP-IDF tools again as described in the Get Started guide.
Code: Select all
$ pyenv version
primary (set by /home/user/.pyenv/version)
$ python --version
Python 3.11.7
Code: Select all
$ /usr/bin/python3 /home/jmux/Documents/esp/esp-idf/tools/idf_tools.py install-python-env
Python 3.10.12
pip 24.0 from /home/user/.espressif/python_env/idf5.1_py3.10_env/lib/python3.10/site-packages/pip (python 3.10)
Upgrading pip and setuptools...
Requirement already satisfied: pip in ./.espressif/python_env/idf5.1_py3.10_env/lib/python3.10/site-packages (24.0)
Requirement already satisfied: setuptools in ./.espressif/python_env/idf5.1_py3.10_env/lib/python3.10/site-packages (69.1.0)
Downloading https://dl.espressif.com/dl/esp-idf/espidf.constraints.v5.1.txt
Destination: /home/user/.espressif/espidf.constraints.v5.1.txt.tmp
Done
Installing Python packages
Constraint file: /home/user/.espressif/espidf.constraints.v5.1.txt
Requirement files:
Try running idf.py in vscode terminal. ENV isn't sourced, source it, same response as in 6. Clicking the compile button (sometimes) works though, not sure why that is.
I'm at my wits end, I'm not sure what else to try. Why is installing the SDK so impossible on what should be the most-supported distribution?
This also isn't even touching the fact that intellisense highlighting in vscode is nearly permanently broken, and other than manually including every possible directory the standard sdk libraries always show red squiggles.
How can I either 1) force ESP-IDF to use a normal pyenv venv that I can manage normally to avoid this headache or 2) get it to actually work with the one it's supposed to come with?
Thanks.