Merge pull request #3753 from Cologler/patch-2

Update core.py
This commit is contained in:
Frost Ming
2019-05-27 11:00:38 +08:00
committed by GitHub
2 changed files with 12 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
Improve the error message of ``pipenv --py`` when virtualenv can't be found.
+11
View File
@@ -1775,6 +1775,17 @@ def ensure_lockfile(keep_outdated=False, pypi_mirror=None):
def do_py(system=False):
if not project.virtualenv_exists:
click.echo(
"{}({}){}".format(
crayons.red("No virtualenv has been created for this project "),
crayons.white(project.project_directory, bold=True),
crayons.red(" yet!")
),
err=True,
)
return
try:
click.echo(which("python", allow_global=system))
except AttributeError: