diff --git a/install.sh b/install.sh
index f3204fd55025a2f06ec3ee9f9110cd750ee060af..aa32f86836df0e0fe5067d3a3046a27a3153f94d 100755
--- a/install.sh
+++ b/install.sh
@@ -5,6 +5,12 @@
 VERSION_NUMBER=$(cat "VERSION")
 echo "installing binarcpython version $VERSION_NUMBER"
 
+# check the BINARY_C environment variable is defined
+if [[ -z "${BINARY_C}" ]]; then
+    echo "Error: The BINARY_C environment variable is not defined. This should point to the directory of your binary_c installation. Please set it and try again."
+    exit
+fi
+
 # we can only use python3 and python3, but allow
 # the user to set these in environment variables
 # PYTHON and PIP.