Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actually filter out missing interpreters #5262

Merged
merged 3 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ How does this pull request fix your problem? Did you consider any alternatives?
### The checklist

* [ ] Associated issue
* [ ] A news fragment in the `news/` directory to describe this fix with the extension `.bugfix`, `.feature`, `.behavior`, `.doc`. `.vendor`. or `.trivial` (this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.
* [ ] A news fragment in the `news/` directory to describe this fix with the extension `.bugfix.rst`, `.feature.rst`, `.behavior.rst`, `.doc.rst`. `.vendor.rst`. or `.trivial.rst` (this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.

<!--
### If this is a patch to the `vendor` directory...
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Or, if you\'re using FreeBSD:
Or, if you\'re using Gentoo:

sudo emerge pipenv

Or, if you\'re using Void Linux:

sudo xbps-install -S python3-pipenv
Expand Down
1 change: 1 addition & 0 deletions news/5261.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix "The Python interpreter can't be found" error when running ``pipenv install --system`` with a python3 but no python.
1 change: 1 addition & 0 deletions pipenv/utils/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ def project_python(project, system=False):
python = project._which("python")
else:
interpreters = [system_which(p) for p in ("python", "python3")]
interpreters = [i for i in interpreters if i] # filter out not found interpreters
python = interpreters[0] if interpreters else None
if not python:
click.secho("The Python interpreter can't be found.", fg="red", err=True)
Expand Down