From 31da5dc0143bd3eb0fc16c50d27275838ad2f75b Mon Sep 17 00:00:00 2001 From: frostming Date: Fri, 28 Jun 2019 13:11:31 +0800 Subject: [PATCH 1/2] Iterate all possible python paths --- pipenv/core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pipenv/core.py b/pipenv/core.py index e0df54e375..90ad558444 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -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( @@ -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()] From 2b6eb7c437856643cf35429fd4ac18bd58bd5f00 Mon Sep 17 00:00:00 2001 From: frostming Date: Fri, 28 Jun 2019 13:19:10 +0800 Subject: [PATCH 2/2] add news --- news/3819.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/3819.bugfix.rst diff --git a/news/3819.bugfix.rst b/news/3819.bugfix.rst new file mode 100644 index 0000000000..a6e05fb5da --- /dev/null +++ b/news/3819.bugfix.rst @@ -0,0 +1 @@ +``pipenv check --system`` should find the correct Python interpreter when ``python`` does not exist on the system.