Skip to content

Commit 53ed144

Browse files
committed
Set DYLD search path for homebrew libs on macOS
1 parent abe4055 commit 53ed144

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

adafruit_platformdetect/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@
55
"""
66
Attempt to detect the current platform.
77
"""
8+
import os
89
import re
10+
import sys
911
from typing import Optional
12+
1013
from .board import Board
1114
from .chip import Chip
1215

16+
# Needed to find libs (like libusb) installed by homebrew on Apple Silicon
17+
if sys.platform == "darwin":
18+
os.environ["DYLD_FALLBACK_LIBRARY_PATH"] = "/opt/homebrew/lib/"
1319

1420
# Various methods here may retain state in future, so tell pylint not to worry
1521
# that they don't use self right now:

0 commit comments

Comments
 (0)