Skip to content

Commit e89c68a

Browse files
committed
Correct pip install help message on Mac
Fixes #654
1 parent a76da61 commit e89c68a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mbed/mbed.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import re
3838
import subprocess
3939
import os
40+
import platform
4041
import contextlib
4142
import shutil
4243
import stat
@@ -1633,8 +1634,10 @@ def check_requirements(self, show_warning=False):
16331634
"Unable to auto-install required Python modules.\n"
16341635
"The mbed OS tools in this program require the following Python modules: %s\n"
16351636
"You can install all missing modules by running \"pip install -r %s\" in \"%s\"" % (', '.join(missing), req_file, req_path))
1636-
if os.name == 'posix':
1637-
msg += "\nOn Posix systems (Linux, Mac, etc) you might have to switch to superuser account or use \"sudo\""
1637+
if os.name == 'posix' and platform.system() == 'Darwin':
1638+
msg += "\nOn Posix systems (Linux, etc) you might have to install packages as your user by adding the \"--user\" flag"
1639+
elif os.name == 'posix':
1640+
msg += "\nOn Posix systems (Linux, etc) you might have to switch to superuser account or use \"sudo\""
16381641

16391642
if show_warning:
16401643
warning(msg)

0 commit comments

Comments
 (0)