diff --git a/pipenv/core.py b/pipenv/core.py index b13cece9..52e7c4d5 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2302,6 +2302,12 @@ def do_clean( # Ensure that virtualenv is available. ensure_project(three=three, python=python, validate=False) + if not project.lockfile_exists: + click.echo( + '{0}: Could not find Pipfile.lock'.format(crayons.red('Warning')) + ) + sys.exit(1) + installed_packages = delegator.run( '{0} freeze'.format(which('pip')) ).out.strip().split('\n') @@ -2344,4 +2350,4 @@ def do_clean( # Uninstall the package. delegator.run('{0} uninstall {1} -y'.format(which('pip'), apparent_bad_package)) - sys.exit(int(success)) \ No newline at end of file + sys.exit(int(success))