diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 25d6ccb0428d8d5a8e90e82672e8f7a26f32502c..7a7e106e82ae453268abc914ec5f209e69042a3a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -108,7 +108,7 @@ flake8:
   variables:
     GIT_STRATEGY: fetch
   before_script:
-    - pip install flake8
+    - pip install 'flake8<3.7'
   script:
     - flake8 -v api
   cache: