Merge pull request #2595 from sinscary/better_error_message

Show better error if virtual env is broken
This commit is contained in:
Tzu-ping Chung
2018-07-18 14:38:20 +08:00
committed by GitHub
+4 -1
View File
@@ -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,
)