diff --git a/qrcode/console_scripts.py b/qrcode/console_scripts.py index 0166f00..c0955fe 100755 --- a/qrcode/console_scripts.py +++ b/qrcode/console_scripts.py @@ -44,7 +44,11 @@ def main(args=None): if args is None: args = sys.argv[1:] - version = metadata.version("qrcode") + try: + version = metadata.version("qrcode") + except metadata.PackageNotFoundError: + version = 'development' + parser = optparse.OptionParser(usage=(__doc__ or "").strip(), version=version) # Wrap parser.error in a typed NoReturn method for better typing.