diff --git a/setup.py b/setup.py
index 9d805a1..ef07485 100644
--- a/setup.py
+++ b/setup.py
@@ -4,9 +4,12 @@ from setuptools import setup, find_packages
 
 VERSION_NUMBER = "1.2.8"
 
-GIT_BRANCH = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"])
-GIT_BRANCH = GIT_BRANCH.decode()  # convert to standard string
-GIT_BRANCH = GIT_BRANCH.rstrip()  # remove unnecessary whitespace
+try:
+    GIT_BRANCH = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"])
+    GIT_BRANCH = GIT_BRANCH.decode()  # convert to standard string
+    GIT_BRANCH = GIT_BRANCH.rstrip()  # remove unnecessary whitespace
+except:
+    GIT_BRANCH = "master"
 
 if GIT_BRANCH == "master":
     DEVELOPMENT_STATUS = "Development Status :: 5 - Production/Stable"
