Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion flit/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,16 @@ def install_requirements(self):
for req_d in requirements
]

# Use either pip in the venv or in the current environment,
# whichever is available.
try:
import pip # noqa: F401
except ImportError:
cmd = [self.python, '-m', 'pip', 'install']
else:
cmd = [sys.executable, '-m', 'pip', 'install', '--python', self.python]

# install the requirements with pip
cmd = [self.python, '-m', 'pip', 'install']
if self.user:
cmd.append('--user')
with tempfile.NamedTemporaryFile(mode='w',
Expand Down