Import Project Example problem. Cannot open ESP-Ardunio project

I wish to load an example from the PIO Home screen
My ESP settings are E:drive as shown:
image

The result is:
image

I try to execute CLI from the terminal: pio init --ide=vscode in the project but get: CommandNotFoundException

However I get the following response when I try to import from PIO Home:

espidf-arduino-wifiscan.
PIO Core Call Error: "The current working directory E:\ESP\ESP32_Projects\210618-192849-espidf-arduino-wifiscan will be used for the project.

The next files/directories have been created in E:\ESP\ESP32_Projects\210618-192849-espidf-arduino-wifiscan
include - Put project header files here
lib - Put here project specific (private) libraries
src - Put project source files here
platformio.ini - Project Configuration File


Error: Traceback (most recent call last):
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\__main__.py", line 109, in main
 cli() # pylint: disable=no-value-for-parameter
 File "e:\esp\esp_idf\penv\lib\site-packages\click\core.py", line 829, in __call__
 return self.main(*args, **kwargs)
 File "e:\esp\esp_idf\penv\lib\site-packages\click\core.py", line 782, in main
 rv = self.invoke(ctx)
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\commands\__init__.py", line 44, in invoke
 return super(PlatformioCLI, self).invoke(ctx)
 File "e:\esp\esp_idf\penv\lib\site-packages\click\core.py", line 1259, in invoke
 return _process_result(sub_ctx.command.invoke(sub_ctx))
 File "e:\esp\esp_idf\penv\lib\site-packages\click\core.py", line 1066, in invoke
 return ctx.invoke(self.callback, **ctx.params)
 File "e:\esp\esp_idf\penv\lib\site-packages\click\core.py", line 610, in invoke
 return callback(*args, **kwargs)
 File "e:\esp\esp_idf\penv\lib\site-packages\click\decorators.py", line 21, in new_func
 return f(get_current_context(), *args, **kwargs)
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\commands\project.py", line 197, in project_init
 pg.generate()
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\ide\projectgenerator.py", line 124, in generate
 tpl_vars = self._load_tplvars()
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\ide\projectgenerator.py", line 76, in _load_tplvars
 tpl_vars.update(load_project_ide_data(self.project_dir, self.env_name) or {})
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\project\helpers.py", line 153, in load_project_ide_data
 raise result.exception
 File "e:\esp\esp_idf\penv\lib\site-packages\click\testing.py", line 329, in invoke
 cli.main(args=args or (), prog_name=prog_name, **extra)
 File "e:\esp\esp_idf\penv\lib\site-packages\click\core.py", line 782, in main
 rv = self.invoke(ctx)
 File "e:\esp\esp_idf\penv\lib\site-packages\click\core.py", line 1066, in invoke
 return ctx.invoke(self.callback, **ctx.params)
 File "e:\esp\esp_idf\penv\lib\site-packages\click\core.py", line 610, in invoke
 return callback(*args, **kwargs)
 File "e:\esp\esp_idf\penv\lib\site-packages\click\decorators.py", line 21, in new_func
 return f(get_current_context(), *args, **kwargs)
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\commands\run\command.py", line 133, in cli
 process_env(
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\commands\run\command.py", line 175, in process_env
 result = {"env": name, "duration": time(), "succeeded": ep.process()}
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\commands\run\processor.py", line 79, in process
 result = p.run(build_vars, build_targets, self.silent, self.verbose, self.jobs)
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\platform\_run.py", line 60, in run
 self.autoinstall_runtime_packages()
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\platform\_packages.py", line 74, in autoinstall_runtime_packages
 self.pm.install(self.get_package_spec(name))
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\package\manager\_install.py", line 48, in install
 pkg = self._install(
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\package\manager\_install.py", line 97, in _install
 pkg = self.install_from_url(spec.url, spec, silent=silent)
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\package\manager\_install.py", line 141, in install_from_url
 vcs = VCSClientFactory.new(tmp_dir, url)
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\package\vcsclient.py", line 54, in new
 obj = getattr(sys.modules[__name__], "%sClient" % type_.title())(
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\package\vcsclient.py", line 137, in __init__
 self.configure()
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\package\vcsclient.py", line 146, in configure
 result = proc.exec_command([cls.command, "--exec-path"])
 File "e:\esp\esp_idf\penv\lib\site-packages\platformio\proc.py", line 117, in exec_command
 p = subprocess.Popen(*args, **kwargs)
 File "E:\ESP\ESP_IDF\python3\lib\subprocess.py", line 951, in __init__
 self._execute_child(args, executable, preexec_fn, close_fds,
 File "E:\ESP\ESP_IDF\python3\lib\subprocess.py", line 1420, in _execute_child
 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Den angivne fil blev ikke fundet

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
 `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
 https://docs.platformio.org/page/faq.html

* Report this problem to the developers
 https://github.com/platformio/platformio-core/issues

===

It’s crashing in the vcsclient.py file when attempting to start a process… Do you have git installed globally?

No git was not installed. I did it now. The files (espidf-arduino-wifiscan) are downloaded as expected in the project folder (that’s no news they allways were) - but the result is:
Could not import project
PIO Core Call Error:

The current working directory E:\ESP\ESP32_Projects\210620-084034-espidf-arduino-wifiscan will be used for the project.

The next files/directories have been created in E:ESPESP32_Projects\210620-084034-espidf-arduino-wifiscan
include - Put project header files here
lib - Put here project specific (private) libraries
src - Put project source files here
platformio.ini - Project Configuration File


Error: Processing esp32dev (board: esp32dev; platform: espressif32; framework: arduino, espidf)
--------------------------------------------------------------------------------
Tool Manager: Installing platformio/tool-cmake @ ~3.16.0
Tool Manager: tool-cmake @ 3.16.4 has been installed!
Tool Manager: Installing platformio/tool-ninja @ ^1.7.0
Tool Manager: tool-ninja @ 1.9.0 has been installed!
Tool Manager: Installing platformio/tool-mconf @ ~1.4060000.0
Tool Manager: tool-mconf @ 1.4060000.20190628 has been installed!
Tool Manager: Installing platformio/tool-idf @ ~1.0.1
Tool Manager: tool-idf @ 1.0.1 has been installed!
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.2.1) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 0.0.0+sha.d011dd7 
 - framework-espidf 3.40001.200521 (4.0.1) 
 - tool-cmake 3.16.4 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - tool-idf 1.0.1 
 - tool-mconf 1.4060000.20190628 (406.0.0) 
 - tool-ninja 1.9.0 
 - toolchain-esp32ulp 1.22851.191205 (2.28.51) 
 - toolchain-xtensa32 2.80400.210211 (8.4.0)
Installing ESP-IDF’s Python dependencies
Collecting cryptography>=2.1.4
 Using cached cryptography-3.4.7-cp36-abi3-win_amd64.whl (1.6 MB)
Collecting future>=0.15.2
 Using cached future-0.18.2-py3-none-any.whl
Collecting pyparsing<2.4.0,>=2.0.3
 Using cached pyparsing-2.3.1-py2.py3-none-any.whl (61 kB)
Collecting cffi>=1.12
 Using cached cffi-1.14.5-cp39-cp39-win_amd64.whl (179 kB)
Collecting pycparser
 Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
Installing collected packages: pycparser, cffi, pyparsing, future, cryptography
Successfully installed cffi-1.14.5 cryptography-3.4.7 future-0.18.2 pycparser-2.20 pyparsing-2.3.1
Installing windows-curses package
Processing e:espesp_idfpackagesramework-espidf	oolskconfig_newesp-windows-curses
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘E:\ESP\ESP_IDF\packages\framework-espidf\tools\kconfig_new\esp-windows-curses’

*** Error 1
Warning! Arduino framework as an ESP-IDF component doesn’t handle the variant field! The default esp32 variant will be used.
Reading CMake configuration…
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Configuring incomplete, errors occurred!
See also “E:/ESP/ESP32_Projects/210620-084034-espidf-arduino-wifiscan/.pio/build/esp32dev/CMakeFiles/CMakeOutput.log”.
See also “E:/ESP/ESP32_Projects/210620-084034-espidf-arduino-wifiscan/.pio/build/esp32dev/CMakeFiles/CMakeError.log”.

CMake Error at CMakeLists.txt:2 (include):
 include could not find load file:

 E:\ESP\ESP_IDF\packages\framework-espidf/tools/cmake/project.cmake


CMake Error at CMakeLists.txt:3 (project):
 No CMAKE_C_COMPILER could be found.

 Tell CMake where to find the compiler by setting either the environment
 variable “CC” or the CMake cache entry CMAKE_C_COMPILER to the full path to
 the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:3 (project):
 No CMAKE_CXX_COMPILER could be found.

 Tell CMake where to find the compiler by setting either the environment
 variable “CXX” or the CMake cache entry CMAKE_CXX_COMPILER to the full path
 to the compiler, or to the compiler name if it is in the PATH.



========================= [FAILED] Took 50.08 seconds =========================

Environment Status Duration
------------- -------- ------------
esp32dev FAILED 00:00:50.082
==================== 1 failed, 0 succeeded in 00:00:50.082 ===================="

May I add my extensions:

If I try to read the error message:
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘E:\ESP\ESP_IDF\packages\framework-espidf\tools\kconfig_new\esp-windows-curses’
image

As you can se - from “tools” and forward are missing

The framework-espidf folder should look like

Tr y removing the whole folder again and rebuild the project to trigger a re-download.

2 Likes

WOW - you are simply the best !!! I followed your advice - deleted “framework-espidf” and reloaded the project. The project can build and uploaded. However debugging gives an error… I have to investigate why I cannot debug. LIBUSB error - I will check if it allready has been reported.
However this topic may be marked as solved. I have flipped the solution tick.

1 Like

Thank you! I just closed VScode, deleted the folder, then I opened VScode and imported the project without problems. :slight_smile: