Skip to content

Commit 25c02f0

Browse files
author
Frost Ming
authored
Merge pull request #3753 from Cologler/patch-2
Update core.py
2 parents 7ded0ad + 550cefb commit 25c02f0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

news/3753.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve the error message of ``pipenv --py`` when virtualenv can't be found.

pipenv/core.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,17 @@ def ensure_lockfile(keep_outdated=False, pypi_mirror=None):
17751775

17761776

17771777
def do_py(system=False):
1778+
if not project.virtualenv_exists:
1779+
click.echo(
1780+
"{}({}){}".format(
1781+
crayons.red("No virtualenv has been created for this project "),
1782+
crayons.white(project.project_directory, bold=True),
1783+
crayons.red(" yet!")
1784+
),
1785+
err=True,
1786+
)
1787+
return
1788+
17781789
try:
17791790
click.echo(which("python", allow_global=system))
17801791
except AttributeError:

0 commit comments

Comments
 (0)