File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ def python_is_compatible():
7575
7676
7777def install_requirements (use_pytorch_nightly ):
78+ # Prevent pip install on Intel-based macOS systems (no prebuilt PyTorch binaries available).
79+ if use_pytorch_nightly and is_intel_mac_os ():
80+ sys .exit (1 )
81+
7882 # pip packages needed by exir.
7983 TORCH_PACKAGE = [
8084 # Setting use_pytorch_nightly to false to test the pinned PyTorch commit. Note
@@ -163,6 +167,24 @@ def install_optional_example_requirements(use_pytorch_nightly):
163167 )
164168
165169
170+ # Prebuilt binaries for Intel-based macOS are no longer available on PyPI; users must compile from source.
171+ # PyTorch stopped building macOS x86_64 binaries since version 2.3.0 (January 2024).
172+ def is_intel_mac_os ():
173+ # Returns True if running on Intel-based macOS
174+ if platform .system ().lower () == "darwin" and platform .machine ().lower () in (
175+ "x86" ,
176+ "x86_64" ,
177+ "i386" ,
178+ ):
179+ print (
180+ "ERROR: Prebuilt PyTorch binaries are no longer available for Intel-based macOS.\n "
181+ "Please compile from source by following https://pytorch.org/executorch/0.6/using-executorch-building-from-source.html" ,
182+ file = sys .stderr ,
183+ )
184+ return True
185+ return False
186+
187+
166188def main (args ):
167189 parser = argparse .ArgumentParser ()
168190 parser .add_argument (
You can’t perform that action at this time.
0 commit comments