Restart VSCode.
Error: Traceback (most recent call last):
File "/Users/kj-jang/.platformio/penv/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
exec(code, run_globals)
File "/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/platformio/__main__.py", line 21, in <module>
from platformio import __version__, exception, maintenance
File "/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/platformio/maintenance.py", line 22, in <module>
from platformio import __version__, app, exception, fs, telemetry
File "/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/platformio/telemetry.py", line 28, in <module>
import requests
File "/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/requests/__init__.py", line 45, in <module>
from .exceptions import RequestsDependencyWarning
File "/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/requests/exceptions.py", line 9, in <module>
from .compat import JSONDecodeError as CompatJSONDecodeError
File "/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/requests/compat.py", line 13, in <module>
import charset_normalizer as chardet
File "/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/charset_normalizer/__init__.py", line 24, in <module>
from .api import from_bytes, from_fp, from_path
File "/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/charset_normalizer/api.py", line 5, in <module>
from .cd import (
File "/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/charset_normalizer/cd.py", line 9, in <module>
from .md import is_suspiciously_successive_range
ImportError: dlopen(/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/charset_normalizer/md.cpython-310-darwin.so, 0x0002): tried: '/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/charset_normalizer/md.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/charset_normalizer/md.cpython-310-darwin.so' (no such file), '/Users/kj-jang/.platformio/penv/lib/python3.10/site-packages/charset_normalizer/md.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
at /Users/kj-jang/.vscode/extensions/platformio.platformio-ide-3.3.1-darwin-arm64/node_modules/platformio-node-helpers/dist/index.js:1:10851
at ChildProcess.c (/Users/kj-jang/.vscode/extensions/platformio.platformio-ide-3.3.1-darwin-arm64/node_modules/platformio-node-helpers/dist/index.js:1:4598)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1121:16)
at Socket.<anonymous> (node:internal/child_process:479:11)
at Socket.emit (node:events:513:28)
at Socket.emit (node:domain:489:12)
at Pipe.<anonymous> (node:net:757:14)
Solution
The issue is caused by Python's "requests" charset_normalizer dependency which is broken on macOS ARM.
A temporary solution is to install an alternative
charsetdependency. Please open PlatformIO Core CLI and type:Restart VSCode.
%23 Description of problem
Leave a comment...
BEFORE SUBMITTING, PLEASE SEARCH FOR DUPLICATES IN
%23 Configuration
VSCode: 1.80.1
PIO IDE: v3.3.1
System: Darwin, 22.5.0, arm64
%23 Exception