From d89696e36da1277067c055ca83f786f762f02091 Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Sun, 22 Oct 2017 20:21:11 -0700 Subject: [PATCH] improve messaging for failed requirements.txt install --- pipenv/cli.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index cabef225..863ef9ab 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -1771,13 +1771,16 @@ def install( click.echo(crayons.normal(u'Requirements file provided! Importing into Pipfile…', bold=True), err=True) try: import_requirements(r=project.path_to(requirements), dev=dev) - except UnicodeDecodeError: + except (UnicodeDecodeError, pip.exceptions.PipError) as e: + # Don't print the temp file path if remote since it will be deleted. + req_path = requirements_url if remote else project.path_to(requirements) click.echo( crayons.red( u'Unexpected syntax in {0}. Are you sure this is a ' - 'requirements.txt style file?'.format(project.path_to(requirements)) + 'requirements.txt style file?'.format(req_path) ) ) + click.echo(crayons.blue(str(e)), err=True) sys.exit(1) finally: # If requirements file was provided by remote url delete the temporary file