Page 1 of 1

vscode ESP-IDF Setup error

Posted: Tue Oct 25, 2022 4:58 am
by Panometric
I cannot use extension to install esp-idf 4.4.2 (release version)
ModuleNotFoundError: No module named 'setuptools.command.build'

The error message is difficult to understand, should I open an issue on https://github.com/espressif/vscode-esp ... report.yml ?

Relevant Log:

Code: Select all

Processing c:\users\username\esp\esp-idf\tools\kconfig_new\esp-windows-curses
Installing Python packages from C:\Users\username\esp\esp-idf\requirements.txt
    ERROR: Command errored out with exit status 1:
     command: 'C:\mos\.espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-req-build-gxqeo1lb\\setup.py'"'"'; __file__='"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-req-build-gxqeo1lb\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh'
         cwd: C:\Users\username\AppData\Local\Temp\pip-req-build-gxqeo1lb\
    Complete output (34 lines):
    running egg_info
    creating C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info
    writing C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\PKG-INFO
    writing dependency_links to C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\dependency_links.txt
    writing requirements to C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\requires.txt
    writing top-level names to C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\top_level.txt
    writing manifest file 'C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\SOURCES.txt'
    reading manifest file 'C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\SOURCES.txt'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\username\AppData\Local\Temp\pip-req-build-gxqeo1lb\setup.py", line 19, in <module>
        setup(name='esp-windows-curses',
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "distutils\core.py", line 148, in setup
      File "distutils\dist.py", line 966, in run_commands
      File "distutils\dist.py", line 985, in run_command
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\command\egg_info.py", line 299, in run
        self.find_sources()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\command\egg_info.py", line 306, in find_sources
        mm.run()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\command\egg_info.py", line 544, in run
        self.prune_file_list()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\command\egg_info.py", line 596, in prune_file_list
        build = self.get_finalized_command('build')
      File "distutils\cmd.py", line 298, in get_finalized_command
      File "distutils\dist.py", line 857, in get_command_obj
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\dist.py", line 755, in get_command_class
        self.cmdclass[command] = cmdclass = ep.load()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\pkg_resources\__init__.py", line 2450, in load
        return self.resolve()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\pkg_resources\__init__.py", line 2456, in resolve
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
    ModuleNotFoundError: No module named 'setuptools.command.build'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Traceback (most recent call last):
  File "C:\Users\username\esp\esp-idf\tools\idf_tools.py", line 1860, in <module>
    main(sys.argv[1:])
  File "C:\Users\username\esp\esp-idf\tools\idf_tools.py", line 1856, in main
    action_func(args)
  File "C:\Users\username\esp\esp-idf\tools\idf_tools.py", line 1577, in action_install_python_env
    subprocess.check_call(run_args, stdout=sys.stdout, stderr=sys.stderr, env=env_copy)
  File "subprocess.py", line 364, in check_call
subprocess.CalledProcessError: Command '['C:\\mos\\.espressif\\python_env\\idf4.4_py3.8_env\\Scripts\\python.exe', '-m', 'pip', 'install', '--no-warn-script-location', '-r', 'C:\\Users\\username\\esp\\esp-idf\\requirements.txt', '--extra-index-url', 'https://dl.espressif.com/pypi']' returned non-zero exit status 1.
Command failed: "C:\mos\.espressif\tools\idf-python\3.8.7\python.exe" "C:\Users\username\esp\esp-idf\tools\idf_tools.py" install-python-env
    ERROR: Command errored out with exit status 1:
     command: 'C:\mos\.espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-req-build-gxqeo1lb\\setup.py'"'"'; __file__='"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-req-build-gxqeo1lb\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh'
         cwd: C:\Users\username\AppData\Local\Temp\pip-req-build-gxqeo1lb\
    Complete output (34 lines):
    running egg_info
    creating C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info
    writing C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\PKG-INFO
    writing dependency_links to C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\dependency_links.txt
    writing requirements to C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\requires.txt
    writing top-level names to C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\top_level.txt
    writing manifest file 'C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\SOURCES.txt'
    reading manifest file 'C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\SOURCES.txt'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\username\AppData\Local\Temp\pip-req-build-gxqeo1lb\setup.py", line 19, in <module>
        setup(name='esp-windows-curses',
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "distutils\core.py", line 148, in setup
      File "distutils\dist.py", line 966, in run_commands
      File "distutils\dist.py", line 985, in run_command
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\command\egg_info.py", line 299, in run
        self.find_sources()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\command\egg_info.py", line 306, in find_sources
        mm.run()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\command\egg_info.py", line 544, in run
        self.prune_file_list()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\command\egg_info.py", line 596, in prune_file_list
        build = self.get_finalized_command('build')
      File "distutils\cmd.py", line 298, in get_finalized_command
      File "distutils\dist.py", line 857, in get_command_obj
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\dist.py", line 755, in get_command_class
        self.cmdclass[command] = cmdclass = ep.load()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\pkg_resources\__init__.py", line 2450, in load
        return self.resolve()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\pkg_resources\__init__.py", line 2456, in resolve
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
    ModuleNotFoundError: No module named 'setuptools.command.build'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Traceback (most recent call last):
  File "C:\Users\username\esp\esp-idf\tools\idf_tools.py", line 1860, in <module>
    main(sys.argv[1:])
  File "C:\Users\username\esp\esp-idf\tools\idf_tools.py", line 1856, in main
    action_func(args)
  File "C:\Users\username\esp\esp-idf\tools\idf_tools.py", line 1577, in action_install_python_env
    subprocess.check_call(run_args, stdout=sys.stdout, stderr=sys.stderr, env=env_copy)
  File "subprocess.py", line 364, in check_call
subprocess.CalledProcessError: Command '['C:\\mos\\.espressif\\python_env\\idf4.4_py3.8_env\\Scripts\\python.exe', '-m', 'pip', 'install', '--no-warn-script-location', '-r', 'C:\\Users\\username\\esp\\esp-idf\\requirements.txt', '--extra-index-url', 'https://dl.espressif.com/pypi']' returned non-zero exit status 1.
Command failed: "C:\mos\.espressif\tools\idf-python\3.8.7\python.exe" "C:\Users\username\esp\esp-idf\tools\idf_tools.py" install-python-env
    ERROR: Command errored out with exit status 1:
     command: 'C:\mos\.espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-req-build-gxqeo1lb\\setup.py'"'"'; __file__='"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-req-build-gxqeo1lb\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh'
         cwd: C:\Users\username\AppData\Local\Temp\pip-req-build-gxqeo1lb\
    Complete output (34 lines):
    running egg_info
    creating C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info
    writing C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\PKG-INFO
    writing dependency_links to C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\dependency_links.txt
    writing requirements to C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\requires.txt
    writing top-level names to C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\top_level.txt
    writing manifest file 'C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\SOURCES.txt'
    reading manifest file 'C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-jbyzzizh\esp_windows_curses.egg-info\SOURCES.txt'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\username\AppData\Local\Temp\pip-req-build-gxqeo1lb\setup.py", line 19, in <module>
        setup(name='esp-windows-curses',
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "distutils\core.py", line 148, in setup
      File "distutils\dist.py", line 966, in run_commands
      File "distutils\dist.py", line 985, in run_command
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\command\egg_info.py", line 299, in run
        self.find_sources()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\command\egg_info.py", line 306, in find_sources
        mm.run()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\command\egg_info.py", line 544, in run
        self.prune_file_list()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\command\egg_info.py", line 596, in prune_file_list
        build = self.get_finalized_command('build')
      File "distutils\cmd.py", line 298, in get_finalized_command
      File "distutils\dist.py", line 857, in get_command_obj
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\setuptools\dist.py", line 755, in get_command_class
        self.cmdclass[command] = cmdclass = ep.load()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\pkg_resources\__init__.py", line 2450, in load
        return self.resolve()
      File "C:\mos\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\pkg_resources\__init__.py", line 2456, in resolve
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
    ModuleNotFoundError: No module named 'setuptools.command.build'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Traceback (most recent call last):
  File "C:\Users\username\esp\esp-idf\tools\idf_tools.py", line 1860, in <module>
    main(sys.argv[1:])
  File "C:\Users\username\esp\esp-idf\tools\idf_tools.py", line 1856, in main
    action_func(args)
  File "C:\Users\username\esp\esp-idf\tools\idf_tools.py", line 1577, in action_install_python_env
    subprocess.check_call(run_args, stdout=sys.stdout, stderr=sys.stderr, env=env_copy)
  File "subprocess.py", line 364, in check_call
subprocess.CalledProcessError: Command '['C:\\mos\\.espressif\\python_env\\idf4.4_py3.8_env\\Scripts\\python.exe', '-m', 'pip', 'install', '--no-warn-script-location', '-r', 'C:\\Users\\username\\esp\\esp-idf\\requirements.txt', '--extra-index-url', 'https://dl.espressif.com/pypi']' returned non-zero exit status 1.


Re: vscode ESP-IDF Setup error

Posted: Tue Oct 25, 2022 5:24 am
by Panometric
Deleting both the c:\users\username\esp\esp-idf and c:\mos then restarting the installer again appears to have solved it.