forked from espressif/esp-idf
tools: Prefer python3 during install and export
Install and export script should work on systems without "python" executable. Closes https://github.com/espressif/esp-idf/pull/6471 Closes https://github.com/espressif/esp-idf/issues/6532 Related to https://github.com/espressif/esp-idf/issues/6421 and https://github.com/espressif/arduino-esp32/issues/4717
This commit is contained in:
@@ -79,11 +79,14 @@ idf_export_main() {
|
||||
|
||||
old_path="$PATH"
|
||||
|
||||
echo "Detecting the Python interpreter"
|
||||
. "${IDF_PATH}/tools/detect_python.sh"
|
||||
|
||||
echo "Adding ESP-IDF tools to PATH..."
|
||||
# Call idf_tools.py to export tool paths
|
||||
export IDF_TOOLS_EXPORT_CMD=${IDF_PATH}/export.sh
|
||||
export IDF_TOOLS_INSTALL_CMD=${IDF_PATH}/install.sh
|
||||
idf_exports=$("${IDF_PATH}/tools/idf_tools.py" export) || return 1
|
||||
idf_exports=$("$ESP_PYTHON" "${IDF_PATH}/tools/idf_tools.py" export) || return 1
|
||||
eval "${idf_exports}"
|
||||
|
||||
echo "Using Python interpreter in $(which python)"
|
||||
@@ -125,6 +128,7 @@ idf_export_main() {
|
||||
unset path_entry
|
||||
unset IDF_ADD_PATHS_EXTRAS
|
||||
unset idf_exports
|
||||
unset ESP_PYTHON
|
||||
|
||||
# Not unsetting IDF_PYTHON_ENV_PATH, it can be used by IDF build system
|
||||
# to check whether we are using a private Python environment
|
||||
|
Reference in New Issue
Block a user