espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.91k stars 7.33k forks source link

Cannot create virtual environment esp-idf (IDFGH-10869) #12071

Closed mrezzaaa closed 1 year ago

mrezzaaa commented 1 year ago

Answers checklist.

IDF version.

v5.0.3

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.

None

What is the expected behavior?

I want to run ./install.sh and expecting installation success & continue to . ./export.sh

What is the actual behavior?

Conflicting happen when upgrading to v5.0.3 (stable) with environment miniconda3 installed. With previous version i have v5.0.1 it's run flawlessly with miniconda3

Steps to reproduce.

  1. Do upgrade like explained on esp-idf documentation page
  2. Trying to deactivate conda virtual environment, same issue appears.

Build or installation Logs.

Detecting the Python interpreter
Checking "python3" ...
Python 3.11.3
"python3" has been detected
Checking Python compatibility
Installing ESP-IDF tools
Current system platform: macos-arm64
Updating /Users/icewalker/esp-idf/components/esptool_py/esptool/idf-env.json
Selected targets are: esp32s2, esp32h2, esp32s3, esp32c2, esp32c3, esp32
Installing tools: xtensa-esp-elf-gdb, riscv32-esp-elf-gdb, xtensa-esp32-elf, xtensa-esp32s2-elf, xtensa-esp32s3-elf, riscv32-esp-elf, esp32ulp-elf, openocd-esp32, esp-rom-elfs
Skipping xtensa-esp-elf-gdb@11.2_20220823 (already installed)
Skipping riscv32-esp-elf-gdb@11.2_20220823 (already installed)
Skipping xtensa-esp32-elf@esp-2022r1-11.2.0 (already installed)
Skipping xtensa-esp32s2-elf@esp-2022r1-11.2.0 (already installed)
Skipping xtensa-esp32s3-elf@esp-2022r1-11.2.0 (already installed)
Skipping riscv32-esp-elf@esp-2022r1-11.2.0 (already installed)
Skipping esp32ulp-elf@2.35_20220830 (already installed)
Skipping openocd-esp32@v0.12.0-esp32-20230419 (already installed)
Skipping esp-rom-elfs@20220823 (already installed)
Installing Python environment and packages
Creating a new Python environment in /Users/icewalker/opt/miniconda3/bin/python
Error: [Errno 20] Not a directory: '/Users/icewalker/opt/miniconda3/bin/python'
Traceback (most recent call last):
  File "/Users/icewalker/esp-idf/esp-idf/tools/idf_tools.py", line 2637, in <module>
    main(sys.argv[1:])
  File "/Users/icewalker/esp-idf/esp-idf/tools/idf_tools.py", line 2629, in main
    action_func(args)
  File "/Users/icewalker/esp-idf/esp-idf/tools/idf_tools.py", line 2049, in action_install_python_env
    subprocess.check_call([sys.executable, '-m', 'venv',
  File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Users/icewalker/.espressif/python_env/idf5.0_py3.11_env/bin/python3', '-m', 'venv', '--clear', '--upgrade-deps', '/Users/icewalker/opt/miniconda3/bin/python']' returned non-zero exit status 1.

More Information.

No response

dobairoland commented 1 year ago

Is it possible that you have made previously permanent ESP-IDF settings to your environment? For example, have you set the IDF_PYTHON_ENV_PATH environment variable? That would explain to try to use /Users/icewalker/opt/miniconda3/bin/python as the environment. That looks completely wrong.

mrezzaaa commented 1 year ago

which should i use IDF_PYTHON_ENV_PATH to ?

dobairoland commented 1 year ago

That shouldn't be set at all. It is used for very specific and advanced purposes.

mrezzaaa commented 1 year ago

you're right. IDF_PYTHON_ENV_PATH i just comment section of IDF_PYTHON_ENV_PATH and now it works. I forgot why i setted it manually. But for now, it's running again. Thanks for helping me @dobairoland