From c7f483d9707bf6cbbfa5371a4eb2a57b05ef31af Mon Sep 17 00:00:00 2001 From: Will Kahn-Greene Date: Tue, 29 Sep 2015 11:30:35 -0400 Subject: [PATCH] [bug 1116489] Tweak ImportError message in manage.py If they have a virtual environment activated, then the problem is probably either they haven't installed the requirements or they haven't updated them in a while. If they don't have a virtual environment actiivated, then they need to activate it. This code change attempts to distinguish between the two by looking for VIRTUAL_ENV in the environment. --- manage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manage.py b/manage.py index f17aebcee..b8bd521ad 100755 --- a/manage.py +++ b/manage.py @@ -18,7 +18,10 @@ except ImportError: print 'OH NOES! There was an import error:' print '' print ''.join(traceback.format_exception(*sys.exc_info())) - print 'Have you activated your virtual environment?' + if 'VIRTUAL_ENV' in os.environ: + print 'Have you installed requirements? Are they up-to-date?' + else: + print 'Have you activated your virtual environment?' sys.exit(1) # Import for side-effect: configures our logging handlers.