Skip to content

Commit

Permalink
Show better error if virtual env is broken
Browse files Browse the repository at this point in the history
Closes pypa#1918
  • Loading branch information
sinscary committed Jul 17, 2018
1 parent 91b39d3 commit 5284454
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,12 +636,15 @@ def ensure_project(
):
click.echo(
"{0}: Your Pipfile requires {1} {2}, "
"but you are using {3} ({4}).".format(
"but you are using {3} ({4}). Running"
"{5} && {6} may resolve the issue.".format(
crayons.red("Warning", bold=True),
crayons.normal("python_version", bold=True),
crayons.blue(project.required_python_version),
crayons.blue(python_version(path_to_python)),
crayons.green(shorten_path(path_to_python)),
crayons.green("`pipenv --rm`"),
crayons.green("`pipenv install`")
),
err=True,
)
Expand Down

0 comments on commit 5284454

Please sign in to comment.