diff --git a/.travis.yml b/.travis.yml
index e89fca16f2..c281373ecc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,30 +12,6 @@ jobs:
     - name: "Python 2.7 on Linux"
       env: NODE_GYP_FORCE_PYTHON=python2
       python: 2.7
-    - name: "Python 2.7 on macOS"
-      os: osx
-      osx_image: xcode11.2
-      language: shell  # 'language: python' is not yet supported on macOS
-      env: NODE_GYP_FORCE_PYTHON=python2
-      before_install:
-        - pyenv install 2.7
-        - pyenv global 2.7
-    - name: "Node.js 6 & Python 2.7 on Windows"
-      os: windows
-      language: node_js
-      node_js: 6  # node
-      env: >-
-        PATH=/c/Python27:/c/Python27/Scripts:$PATH
-        NODE_GYP_FORCE_PYTHON=/c/Python27/python.exe
-      before_install: choco install python2
-    - name: "Node.js 12 & Python 2.7 on Windows"
-      os: windows
-      language: node_js
-      node_js: 12  # node
-      env: >-
-        PATH=/c/Python27:/c/Python27/Scripts:$PATH
-        NODE_GYP_FORCE_PYTHON=/c/Python27/python.exe
-      before_install: choco install python2
 
     - name: "Node.js 6 & Python 3.8 on Linux"
       python: 3.8
@@ -67,11 +43,36 @@ jobs:
       env: NODE_GYP_FORCE_PYTHON=python3
       before_install: nvm install 12
 
-    - name: "Python 3.7 on macOS"
+    - name: "Python 2.7 on macOS"
       os: osx
       osx_image: xcode11.2
       language: shell  # 'language: python' is not yet supported on macOS
-      env: NODE_GYP_FORCE_PYTHON=python3
+      env: NODE_GYP_FORCE_PYTHON=python2 PATH=$HOME/.pyenv/shims:$PATH PYENV_VERSION=2.7.17
+      before_install: pyenv install $PYENV_VERSION
+    - name: "Python 3.8 on macOS"
+      os: osx
+      osx_image: xcode11.2
+      language: shell  # 'language: python' is not yet supported on macOS
+      env: NODE_GYP_FORCE_PYTHON=python3 PATH=$HOME/.pyenv/shims:$PATH PYENV_VERSION=3.8.0
+      before_install: pyenv install $PYENV_VERSION
+
+    - name: "Node.js 6 & Python 2.7 on Windows"
+      os: windows
+      language: node_js
+      node_js: 6  # node
+      env: >-
+        PATH=/c/Python27:/c/Python27/Scripts:$PATH
+        NODE_GYP_FORCE_PYTHON=/c/Python27/python.exe
+      before_install: choco install python2
+    - name: "Node.js 12 & Python 2.7 on Windows"
+      os: windows
+      language: node_js
+      node_js: 12  # node
+      env: >-
+        PATH=/c/Python27:/c/Python27/Scripts:$PATH
+        NODE_GYP_FORCE_PYTHON=/c/Python27/python.exe
+      before_install: choco install python2
+
     - name: "Node.js 12 & Python 3.7 on Windows"
       os: windows
       language: node_js
@@ -90,20 +91,19 @@ jobs:
       before_install: choco install python
 
 install:
-  #- pip install -r requirements.txt
-  - pip install --upgrade flake8 pytest==4.6.6  # pytest 5 no longer supports legacy Python
+  - python -m pip install --upgrade flake8 pytest==4.6.6  # pytest 5 no longer supports legacy Python
 before_script:
-  - flake8 --version
+  - python -m flake8 --version
   # stop the build if there are Python syntax errors or undefined names
-  - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+  - python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
   # exit-zero treats all errors as warnings.  Two space indentation is OK.  The GitHub editor is 127 chars wide
-  - flake8 . --count --exit-zero --ignore=E111,E114,W503 --max-complexity=10 --max-line-length=127 --statistics
+  - python -m flake8 . --count --exit-zero --ignore=E111,E114,W503 --max-complexity=10 --max-line-length=127 --statistics
   - npm install
   - npm list
 script:
   - node -e 'require("npmlog").level="verbose"; require("./lib/find-python")(null,()=>{})'
   - npm test
-  - GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" pytest
+  - GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" python -m pytest
 notifications:
   on_success: change
   on_failure: change  # `always` will be the setting once code changes slow down