Skip to content

Commit d0ee517

Browse files
authored
fix: install Python deps with sys.executable pip module (#1194)
1 parent 5bf7966 commit d0ee517

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

install-eaf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
args = parser.parse_args()
3838

3939
NPM_CMD = "npm.cmd" if sys.platform == "win32" else "npm"
40-
PIP_CMD = "pip3" if which("pip3") else "pip" # mac only have pip3, so we need use pip3 instead pip
40+
PIP_CMD = [sys.executable, "-m", "pip"]
4141

4242
class bcolors:
4343
HEADER = '\033[95m'
@@ -154,12 +154,12 @@ def install_py_deps(deps_list):
154154
if sys.prefix == sys.base_prefix:
155155
# pass --break-system-packages to permit installing packages into EXTERNALLY-MANAGED Python installations. see https://github.com/pypa/pip/issues/11780
156156
if get_distro() != "guix" and os.path.exists(os.path.join(sysconfig.get_path("stdlib", sysconfig.get_default_scheme() if hasattr(sysconfig, "get_default_scheme") else sysconfig._get_default_scheme()),"EXTERNALLY-MANAGED")):
157-
command = [PIP_CMD, 'install', '--user', '--break-system-packages', '-U']
157+
command = PIP_CMD + ['install', '--user', '--break-system-packages', '-U']
158158
else:
159-
command = [PIP_CMD, 'install', '--user', '-U']
159+
command = PIP_CMD + ['install', '--user', '-U']
160160
else:
161161
# if running on a virtual env, --user option is not valid.
162-
command = [PIP_CMD, 'install', '-U']
162+
command = PIP_CMD + ['install', '-U']
163163
command.extend(deps_list)
164164
try:
165165
run_command(command)

0 commit comments

Comments
 (0)