Created
February 27, 2014 20:45
-
-
Save happysundar/9259182 to your computer and use it in GitHub Desktop.
check python version, virtual env presence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check_env(): | |
(py_major, py_minor, py_patchlevel) = platform.python_version_tuple() | |
if py_major != '2' and py_minor != '7': | |
exit("This script should be run in python version 2.7.X. Current version of python is %s" % platform.python_version()) | |
if not hasattr(sys, 'real_prefix'): | |
exit("This script should be run within a virtualevn. Have you run the 'workon <virtual_env_name>' command?") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment