From f141911dabe725c9e6403647e4c46e914b7bf095 Mon Sep 17 00:00:00 2001 From: Nitesh Sharma Date: Tue, 17 Jul 2018 13:58:11 +0530 Subject: [PATCH] Show better error if virtual env is broken Closes https://github.com/pypa/pipenv/issues/1918 --- pipenv/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index a678a3b2..a6372ad2 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -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} and rebuild the virtual environment" + "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`") ), err=True, )