From 9170eee6e465b0baba9977e0fe964689f0e667bb Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 29 Jul 2023 16:03:14 +0300 Subject: [PATCH] Resolved an issue with "ModuleNotFoundError: No module named 'chardet'" on macOS ARM // Resolve #4702 --- HISTORY.rst | 1 + setup.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index cfe23a1c..c66f136c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -22,6 +22,7 @@ PlatformIO Core 6 * Resolved an issue encountered while utilizing the `pio pkg exec `__ command on the Windows platform to execute Python scripts from a package * Implemented a crucial improvement to the `pio run `__ command, guaranteeing that the ``monitor`` target is not executed if any of the preceding targets, such as ``upload``, encounter failures * `Cppcheck `__ v2.11 with new checks, CLI commands and various analysis improvements +* Resolved a critical issue that arose on macOS ARM platforms due to the Python "requests" module, leading to a "ModuleNotFoundError: No module named 'chardet'" (`issue #4702 `_) 6.1.9 (2023-07-06) ~~~~~~~~~~~~~~~~~~ diff --git a/setup.py b/setup.py index 5872ccf5..46716cc5 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,9 @@ from platformio import ( __install_requires__, ) +# issue #4702; Broken "requests/charset_normalizer" on macOS ARM +if platform.system() == "Darwin" and "arm" in platform.machine().lower(): + __install_requires__.append("chardet>=3.0.2,<4") setup(