Skip to content

Commit

Permalink
Merge pull request #3820 from pypa/bugfix/3818
Browse files Browse the repository at this point in the history
Find the python interpreter for pipenv check --system.
  • Loading branch information
frostming authored Jun 28, 2019
2 parents 207f2f5 + 2b6eb7c commit 4c00352
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/3819.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``pipenv check --system`` should find the correct Python interpreter when ``python`` does not exist on the system.
8 changes: 6 additions & 2 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2578,8 +2578,9 @@ def do_check(
args=None,
pypi_mirror=None,
):
from .environments import is_verbose
from pipenv.vendor.vistir.compat import JSONDecodeError
from pipenv.vendor.first import first

if not system:
# Ensure that virtualenv is available.
ensure_project(
Expand Down Expand Up @@ -2618,7 +2619,10 @@ def do_check(
if not system:
python = which("python")
else:
python = system_which("python")
python = first(system_which(p) for p in ("python", "python3", "python2"))
if not python:
click.echo(crayons.red("The Python interpreter can't be found."), err=True)
sys.exit(1)
_cmd = [vistir.compat.Path(python).as_posix()]
# Run the PEP 508 checker in the virtualenv.
cmd = _cmd + [vistir.compat.Path(pep508checker_path).as_posix()]
Expand Down

0 comments on commit 4c00352

Please sign in to comment.