diff --git a/install/from-scratch.sh b/install/from-scratch.sh
index 5013dd140bbfb2f469f5c7c14a67acf0b1d6f381..dd1e433f2de47cec5c6377364e0b0c99871e6d62 100755
--- a/install/from-scratch.sh
+++ b/install/from-scratch.sh
@@ -28,6 +28,12 @@ else
     CAFFE=
 fi
 
+if [ "$(uname)" == "Linux" ]; then
+    TENSORFLOW=tensorflow
+else
+    TENSORFLOW=
+fi
+
 # For a complete list of dependencies, please read:
 # https://gitlab.idiap.ch/bob/bob/wikis/Dependencies
 echo "[>>] Creating environment ${NAME} for python ${PYTHON_VERSION} with bob dependencies..."
@@ -73,13 +79,20 @@ ${CONDA} create --yes -n ${NAME} \
   sphinx=1.4.6 \
   sphinx_rtd_theme \
   sqlalchemy=1.0.13 \
-  tensorflow \
+  ${TENSORFLOW} \
   virtualenv \
   vlfeat=0.9.20
 
 echo "[>>] Pip-installing extra dependencies in environment ${NAME} for ${PYTHON_VERSION}..."
 source ${BASEDIR}/bin/activate ${NAME}
 
+# pip install tensorflow in mac
+if [ "$(uname)" == "Darwin" ]; then
+  pip install tensorflow
+  # test tensorflow
+  python -c "import tensorflow"
+fi
+
 # Cyvlfeat requires special instructions
 cyvlfeat=git+https://github.com/menpo/cyvlfeat@v0.4.5
 if [ "$(uname)" == "Linux" ]; then