diff --git a/buildscripts/winbuild.sh b/buildscripts/winbuild.sh
index 66beea65..43d8cf34 100755
--- a/buildscripts/winbuild.sh
+++ b/buildscripts/winbuild.sh
@@ -99,7 +99,8 @@ function install_pyinstaller()
 	cd "${BASE_DIR}" || exit 1
 	echo "Installing PyInstaller"
 	if [ "${MACHINE_TYPE}" == 'x86_64' ]; then
-		wine python -m pip install pyinstaller
+                # 3.6 is the last version to support python 2.7
+		wine python -m pip install -I pyinstaller==3.6
 	else
 		# 3.2.1 is the last version to work on XP
 		# see https://github.com/pyinstaller/pyinstaller/issues/2931