https://github.com/galaxyproject/galaxy
Raw File
Tip revision: 55beabf25a91e9363e9acbe773ca803e4c557409 authored by John Chilton on 04 July 2020, 14:26:59 UTC
Version 20.5.0 of test-base (tag galaxy-test-base-20.5.0).
Tip revision: 55beabf
check_python.py
"""
If the current installed Python version is not supported, prints an error
message to stderr and returns 1
"""
from __future__ import print_function

import sys


def check_python():
    if sys.version_info[:2] >= (3, 5):
        # supported
        return
    else:
        version_string = '.'.join(str(_) for _ in sys.version_info[:3])
        msg = """\
ERROR: Your Python version is: %s
Galaxy is currently supported on Python >=3.5 .
To run Galaxy, please install a supported Python version.
If a supported version is already installed but is not your default,
https://docs.galaxyproject.org/en/latest/admin/python.html contains instructions
on how to force Galaxy to use a different version.""" % version_string
        print(msg, file=sys.stderr)
        raise Exception(msg)


if __name__ == '__main__':
    try:
        check_python()
    except Exception:
        sys.exit(1)
back to top