platformio / platformio-home

PlatformIO Home
https://docs.platformio.org/page/home/index.html
Apache License 2.0
93 stars 62 forks source link

Could not initialize project with framework Espidf (Mac): "No module named 'chardet'" #5685

Open jtiscione opened 1 year ago

jtiscione commented 1 year ago

PlatformIO can't create a new project with board lilygo-t-display-s3, framework Espidf. The choice of board doesn't seem to matter, but if the framework is Espidf then it fails. The error is always on the line "import chardet".

PIO Core Call Error: "Resolving lilygo-t-display-s3 dependencies...
Tool Manager: Installing espressif/toolchain-xtensa-esp32s3 @ 11.2.0+2022

Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking
Tool Manager: toolchain-xtensa-esp32s3@11.2.0+2022r1 has been installed!
Tool Manager: Installing espressif/toolchain-riscv32-esp @ 11.2.0+2022r1
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking
Tool Manager: toolchain-riscv32-esp@11.2.0+2022r1 has been installed!
Tool Manager: Installing platformio/toolchain-esp32ulp @ ~1.23500.0\nDownloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking
Tool Manager: toolchain-esp32ulp@1.23500.220830 has been installed!
Tool Manager: Installing platformio/framework-espidf @ ~3.50001.0\nDownloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking
Tool Manager: framework-espidf@3.50001.0 has been installed!
Tool Manager: Installing platformio/tool-cmake @ ~3.16.0\nDownloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking
Tool Manager: tool-cmake@3.16.4 has been installed!\nTool Manager: Installing platformio/tool-ninja @ ^1.7.0
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking
Tool Manager: tool-ninja@1.9.0 has been installed!\nAlready up-to-date.
Updating metadata for the vscode IDE...

Error: Processing lilygo-t-display-s3 (platform: espressif32; board: lilygo-t-display-s3; framework: espidf)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/lilygo-t-display-s3.html
PLATFORM: Espressif 32 (6.2.0) > LilyGo T-Display-S3
HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, 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-espidf @ 3.50001.0 (5.0.1) 
 - tool-cmake @ 3.16.4 
 - tool-esptoolpy @ 1.40501.0 (4.5.1) 
 - tool-ninja @ 1.9.0 
 - toolchain-esp32ulp @ 1.23500.220830 (2.35.0) 
 - toolchain-riscv32-esp @ 11.2.0+2022r1 
 - toolchain-xtensa-esp32s3 @ 11.2.0+2022r1
 Creating a virtual environment for IDF Python dependencies
 Installing ESP-IDF's Python dependencies
 Collecting cryptography
  Downloading cryptography-40.0.2-cp36-abi3-macosx_10_12_universal2.whl (5.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.1/5.1 MB 6.5 MB/s eta 0:00:00
   Collecting future
    Downloading future-0.18.3.tar.gz (840 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 840.9/840.9 kB 10.6 MB/s eta 0:00:00
      Preparing metadata (setup.py): started
      Preparing metadata (setup.py): finished with status 'done'
      Collecting pyparsing
      Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
      Collecting kconfiglib
      Downloading kconfiglib-14.1.0-py2.py3-none-any.whl (145 kB)
      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 145.9/145.9 kB 6.1 MB/s eta 0:00:00
      Collecting idf-component-manager\n Downloading idf_component_manager-1.2.2-py3-none-any.whl (116 kB)
      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 116.7/116.7 kB 4.8 MB/s eta 0:00:00
      Collecting cffi>=1.12
      Downloading cffi-1.15.1-cp310-cp310-macosx_11_0_arm64.whl (174 kB)
      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 174.3/174.3 kB 6.3 MB/s eta 0:00:00
      Collecting tqdm<5\n Downloading tqdm-4.65.0-py3-none-any.whl (77 kB)
      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.1/77.1 kB 2.8 MB/s eta 0:00:00
      Collecting cachecontrol[filecache]>0.12.6
      Downloading CacheControl-0.12.11-py2.py3-none-any.whl (21 kB)
      Collecting six\n Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
      Collecting requests-toolbelt
      Downloading requests_toolbelt-0.10.1-py2.py3-none-any.whl (54 kB)
      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.5/54.5 kB 2.2 MB/s eta 0:00:00
      Collecting requests<3
      Using cached requests-2.29.0-py3-none-any.whl (62 kB)
      Collecting click
      Using cached click-8.1.3-py3-none-any.whl (96 kB)
      Collecting pyyaml>5.2
      Downloading PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl (173 kB)
      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 174.0/174.0 kB 2.5 MB/s eta 0:00:00
      Collecting colorama
      Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
      Collecting schema\n Downloading schema-0.7.5-py2.py3-none-any.whl (17 kB)
      Collecting requests-file\n Downloading requests_file-1.5.1-py2.py3-none-any.whl (3.7 kB)
      Collecting contextlib2>0.6.0
      Downloading contextlib2-21.6.0-py2.py3-none-any.whl (13 kB)
      Collecting packaging\n Using cached packaging-23.1-py3-none-any.whl (48 kB)
      Collecting msgpack>=0.5.2
      Downloading msgpack-1.0.5-cp310-cp310-macosx_11_0_arm64.whl (70 kB)
      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.2/70.2 kB 2.9 MB/s eta 0:00:00
      Collecting lockfile>=0.9
      Downloading lockfile-0.12.2-py2.py3-none-any.whl (13 kB)
      Collecting pycparser\n Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 3.9 MB/s eta 0:00:00
       Collecting urllib3<1.27,>=1.21.1
       Using cached urllib3-1.26.15-py2.py3-none-any.whl (140 kB)
       Collecting idna<4,>=2.5\n Using cached idna-3.4-py3-none-any.whl (61 kB)
       Collecting charset-normalizer<4,>=2
       Using cached charset_normalizer-3.1.0-cp310-cp310-macosx_11_0_arm64.whl (123 kB)
       Collecting certifi>=2017.4.17
       Using cached certifi-2022.12.7-py3-none-any.whl (155 kB)
       Using legacy 'setup.py install' for future, since package 'wheel' is not installed.
       Installing collected packages: msgpack, lockfile, urllib3, tqdm, six, pyyaml, pyparsing, pycparser, packaging, kconfiglib, idna, future, contextlib2, colorama, click, charset-normalizer, certifi, schema, requests, cffi, requests-toolbelt, requests-file, cryptography, cachecontrol, idf-component-manager
       Running setup.py install for future: started
       Running setup.py install for future: finished with status 'done'
       Successfully installed cachecontrol-0.12.11 certifi-2022.12.7 cffi-1.15.1 charset-normalizer-3.1.0 click-8.1.3 colorama-0.4.6 contextlib2-21.6.0 cryptography-40.0.2 future-0.18.3 idf-component-manager-1.2.2 idna-3.4 kconfiglib-14.1.0 lockfile-0.12.2 msgpack-1.0.5 packaging-23.1 pycparser-2.21 pyparsing-3.0.9 pyyaml-6.0 requests-2.29.0 requests-file-1.5.1 requests-toolbelt-0.10.1 schema-0.7.5 six-1.16.0 tqdm-4.65.0 urllib3-1.26.15\n\n[notice] A new release of pip available: 22.2.2 -> 23.1.2\n[notice] To update, run: python -m pip install --upgrade pip
       Reading CMake configuration...
       -- Found Git: /usr/local/bin/git (found version \"2.33.0\") 
       -- The C compiler identification is GNU 11.2.0
       -- The CXX compiler identification is GNU 11.2.0
       - The ASM compiler identification is GNU
       -- Found assembler: /Users/jason/.platformio/packages/toolchain-xtensa-esp32s3/bin/xtensa-esp32s3-elf-gcc
       -- Check for working C compiler: /Users/jason/.platformio/packages/toolchain-xtensa-esp32s3/bin/xtensa-esp32s3-elf-gcc
       -- Check for working C compiler: /Users/jason/.platformio/packages/toolchain-xtensa-esp32s3/bin/xtensa-esp32s3-elf-gcc -- works
       -- Detecting C compiler ABI info
       -- Detecting C compiler ABI info - done
       -- Detecting C compile features
       -- Detecting C compile features - done
       -- Check for working CXX compiler: /Users/jason/.platformio/packages/toolchain-xtensa-esp32s3/bin/xtensa-esp32s3-elf-g++
       -- Check for working CXX compiler: /Users/jason/.platformio/packages/toolchain-xtensa-esp32s3/bin/xtensa-esp32s3-elf-g++ -- works
       -- Detecting CXX compiler ABI info
       -- Detecting CXX compiler ABI info - done
       -- Detecting CXX compile features
       -- Detecting CXX compile features - done
       -- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
       -- Building ESP-IDF components for target esp32s3
       -- Configuring incomplete, errors occurred!
       See also \"/Users/jason/Documents/PlatformIO/Projects/lilygo/.pio/build/lilygo-t-display-s3/CMakeFiles/CMakeOutput.log\".
       fatal: not a git repository (or any of the parent directories): .git
       CMake Error at /Users/jason/.platformio/packages/framework-espidf/tools/cmake/build.cmake:519 (message):

        Traceback (most recent call last):
        File \"/Users/jason/.platformio/penv/.espidf-5.0.1/lib/python3.10/site-packages/requests/compat.py\", line 11, in <module>
         import chardet
        ModuleNotFoundError: No module named 'chardet'
        During handling of the above exception, another exception occurred:

         Traceback (most recent call last):
         File \"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py\", line 196, in _run_module_as_main
         return _run_code(code, main_globals, None,
         File \"/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py\", line 86, in _run_code\n exec(code, run_globals)
         File \"/Users/jason/.platformio/penv/.espidf-5.0.1/lib/python3.10/site-packages/idf_component_manager/prepare_components/__main__.py\", line 4, in <module>
         from .prepare import main
         File \"/Users/jason/.platformio/penv/.espidf-5.0.1/lib/python3.10/site-packages/idf_component_manager/prepare_components/prepare.py\", line 18, in <module>
         from ..core import ComponentManager
         File \"/Users/jason/.platformio/penv/.espidf-5.0.1/lib/python3.10/site-packages/idf_component_manager/core.py\", line 17, in <module>
         import requests
         File \"/Users/jason/.platformio/penv/.espidf-5.0.1/lib/python3.10/site-packages/requests/__init__.py\", line 45, in <module>
         from .exceptions import RequestsDependencyWarning
         File \"/Users/jason/.platformio/penv/.espidf-5.0.1/lib/python3.10/site-packages/requests/exceptions.py\", line 9, in <module>
         from .compat import JSONDecodeError as CompatJSONDecodeError
         File \"/Users/jason/.platformio/penv/.espidf-5.0.1/lib/python3.10/site-packages/requests/compat.py\", line 13, in <module>
         import charset_normalizer as chardet
         File \"/Users/jason/.platformio/penv/.espidf-5.0.1/lib/python3.10/site-packages/charset_normalizer/__init__.py\", line 24, in <module>
         from .api import from_bytes, from_fp, from_path
         File \"/Users/jason/.platformio/penv/.espidf-5.0.1/lib/python3.10/site-packages/charset_normalizer/api.py\", line 5, in <module>
         from .cd import (\n File \"/Users/jason/.platformio/penv/.espidf-5.0.1/lib/python3.10/site-packages/charset_normalizer/cd.py\", line 9, in <module>
         from .md import is_suspiciously_successive_range
         ImportError:
         dlopen(/Users/jason/.platformio/penv/.espidf-5.0.1/lib/python3.10/site-packages/charset_normalizer/md.cpython-310-darwin.so,
         0x0002): tried:
         '/Users/jason/.platformio/penv/.espidf-5.0.1/lib/python3.10/site-packages/charset_normalizer/md.cpython-310-darwin.so'
         (mach-o file, but is an incompatible architecture (have (arm64), need
         (x86_64)))
         Call Stack (most recent call first):
         /Users/jason/.platformio/packages/framework-espidf/tools/cmake/project.cmake:440 (idf_build_process)
         CMakeLists.txt:3 (project)

         ========================= [FAILED] Took 11.61 seconds ========================="
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. Please provide more details or it will be closed if no further activity occurs. Thank you for your contributions.