diff --git a/CMakeLists.txt b/CMakeLists.txt
index bf740e74d1a29d6e822e44698388d2984e7c7fb9..20e7d8a8b1ee12d80245e296a726d6eceffa5040 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,6 +21,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDUNE_ISTL_SUPPORT_OLD_CATEGORY_INTERFA
 # start a dune project with information from dune.module
 dune_project()
 
+dune_python_force_version(3)
+
 dune_add_library(dunecodegen dune/codegen/common/tsc.cc)
 
 dune_target_enable_all_packages(dunecodegen)
diff --git a/python/setup.py b/python/setup.py
index d847cb90064e734efe22ea0646129fa8bb86be35..713ffbab9d5761f775764a67c2807a017a817da4 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -29,6 +29,7 @@ setup(name='dune.codegen',
       description='Performance optimizing form compiler for the Dune project',
       author='Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de>',
       url='https://gitlab.dune-project.org/dominic/dune-codegen.git',
+      python_requires='>=3',
       packages=['dune.codegen',
                 'dune.codegen.blockstructured',
                 'dune.codegen.cgen',