Skip to content

Commit 1096b73

Browse files
authored
Merge pull request #223 from cdwilson/support-homebrew-libusb
Support homebrew libusb on macOS
2 parents abe4055 + 53ed144 commit 1096b73

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)