diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt
index e8ea4bd424beb1d30c28ca716113021b2713aa6b..c78ec839cafed32ce91d1c91b4c561c5715df2fc 100644
--- a/bin/CMakeLists.txt
+++ b/bin/CMakeLists.txt
@@ -1,14 +1,4 @@
-dune_install_python_script(SCRIPT process_measurements.py
-                           REQUIRES pandas
-                           )
-
-dune_install_python_script(SCRIPT plot_measurements.py
-                           REQUIRES pandas matplotlib
-                           )
-
-dune_install_python_script(SCRIPT performance_regression.py
-                           REQUIRES pandas
-                           )
+dune_python_install_package(PATH .)
 
 dune_symlink_to_source_files(FILES make_graph.sh
                              )
diff --git a/bin/setup.py b/bin/setup.py
new file mode 100644
index 0000000000000000000000000000000000000000..6e028cad8b5c30bd6e6feb425fc33faf0a40ecf6
--- /dev/null
+++ b/bin/setup.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+
+#
+# This is a bogus package to install all the python scripts that we need
+# in the bin folder into the Dune virtualenv.
+#
+
+from setuptools import setup
+
+
+setup(name='perftoolcoveniencescripts',
+      version='0.1',
+      description='Some convenience scripts',
+      author='Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de>',
+      install_requires=['pandas', 'matplotlib'],
+      scripts=['performance_regression.py',
+               'plot_measurements.py',
+               'process_measurements.py',
+               ])
diff --git a/cmake/modules/DunePerftoolMacros.cmake b/cmake/modules/DunePerftoolMacros.cmake
index 0b9e63eb51ed57166004e16501fece7411c997ed..f9cd828cf91dc442854158562d9dd6db7d5b68f6 100644
--- a/cmake/modules/DunePerftoolMacros.cmake
+++ b/cmake/modules/DunePerftoolMacros.cmake
@@ -109,7 +109,7 @@ function(add_generated_executable)
   configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/StandardMain.cmake ${GEN_MAIN})
 
   add_custom_command(OUTPUT ${GEN_OPERATOR} ${GEN_DRIVER}
-                     COMMAND ${CMAKE_BINARY_DIR}/dune-env ufl2pdelab
+                     COMMAND ${CMAKE_BINARY_DIR}/run-in-dune-env ufl2pdelab
                              --project-basedir ${CMAKE_BINARY_DIR}
                              --operator-file ${GEN_OPERATOR}
                              --driver-file ${GEN_DRIVER}
diff --git a/cmake/modules/GeneratedSystemtests.cmake b/cmake/modules/GeneratedSystemtests.cmake
index 884f80da5e3be6301ebccad8196546e96ea3b71b..cc2be53ff3670637de2862bbf74e02c4d99815ed 100644
--- a/cmake/modules/GeneratedSystemtests.cmake
+++ b/cmake/modules/GeneratedSystemtests.cmake
@@ -33,7 +33,7 @@ function(dune_add_formcompiler_system_test)
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMTEST_INIFILE} ${CMAKE_CURRENT_BINARY_DIR}/tmp_${SYSTEMTEST_INIFILE})
 
   # expand the given meta ini file into the build tree
-  execute_process(COMMAND ${CMAKE_BINARY_DIR}/dune-env dune_expand_metaini.py --cmake --ini ${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMTEST_INIFILE} --dir ${CMAKE_CURRENT_BINARY_DIR} --section formcompiler
+  execute_process(COMMAND ${CMAKE_BINARY_DIR}/run-in-dune-env dune_expand_metaini.py --cmake --ini ${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMTEST_INIFILE} --dir ${CMAKE_CURRENT_BINARY_DIR} --section formcompiler
                   OUTPUT_VARIABLE output)
   parse_python_data(PREFIX INIINFO INPUT "${output}")
 
@@ -66,7 +66,7 @@ function(dune_add_formcompiler_system_test)
       add_dependencies(build_tests ${tname})
 
       _add_test(NAME ${tname}
-                COMMAND ${CMAKE_BINARY_DIR}/dune-env ${SYSTEMTEST_SCRIPT}
+                COMMAND ${CMAKE_BINARY_DIR}/run-in-dune-env ${SYSTEMTEST_SCRIPT}
                       --exec ${tname}
                       --ini "${CMAKE_CURRENT_BINARY_DIR}/${inifile}"
                       --source ${CMAKE_CURRENT_SOURCE_DIR}
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 6346c1f7ddb14a6c27a5116d3aab925a0d3c86e0..054a09df644957474d6b758ab92ad2cdb7827bf8 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -2,24 +2,22 @@
 #
 # Install path.py in version 7.7 is to avoid a bug in
 # IPythons dependency pickleshare.
-execute_process(COMMAND ${CMAKE_BINARY_DIR}/dune-env python -m pip install path.py==7.7 tornado>=4.0 ipython>=4.0.0 jupyter>=1.0.0)
-
-# Create an ipython notebook wrapper!
-create_virtualenv_wrapper(COMMANDS python -m IPython notebook
-                          NAME notebook)
+dune_execute_process(COMMAND ${DUNE_PYTHON_VIRTUALENV_EXECUTABLE} -m pip install path.py==7.7 tornado>=4.0 ipython>=4.0.0 jupyter>=1.0.0
+                     ERROR_MESSAGE "Error installing jupyter in virtualenv")
 
 # Install all the external packages that we have as submodules
-dune_install_python_package(PATH pytools)
-dune_install_python_package(PATH cgen)
-dune_install_python_package(PATH pymbolic)
-dune_install_python_package(PATH loopy)
-dune_install_python_package(PATH ufl)
+dune_python_install_package(PATH pytools)
+dune_python_install_package(PATH cgen)
+dune_python_install_package(PATH pymbolic)
+dune_python_install_package(PATH loopy)
+dune_python_install_package(PATH ufl)
 
 # Install our python package
-dune_install_python_package(PATH .)
+dune_python_install_package(PATH .)
 
-add_python_test_command(COMMAND python -m pytest --pep8
-                        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python/dune/perftool
-                        REQUIRED_PACKAGES pytest pytest-pep8)
+dune_python_add_test(NAME pep8-ourcode
+                     COMMAND ${DUNE_PYTHON_VIRTUALENV_EXECUTABLE} -m pytest --pep8
+                     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python/dune/perftool
+                     )
 
 add_subdirectory(test)
diff --git a/python/setup.py b/python/setup.py
index 6d7a069d67c68e51d00f667ca123bf44210620cf..b5cd773887f8da0285929e08dd122325a6d8dad6 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -30,8 +30,7 @@ setup(name='dune.perftool',
       author='Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de>',
       url='http://conan2.iwr.uni-heidelberg.de/git/dominic/dune-perftool',
       packages=['dune.perftool'],
-      install_requires=['dune.testtools', 'sympy'],
-      tests_require=['pytest'],
+      install_requires=['dune.testtools', 'sympy', 'pytest', 'pytest-pep8'],
       cmdclass={'test': PyTest},
       entry_points = {
         "console_scripts": [
diff --git a/python/test/dune/perftool/generation/CMakeLists.txt b/python/test/dune/perftool/generation/CMakeLists.txt
index 47b168aee0ae8c454ebe6f74f8c617b5eb7bf076..ac853807fc3b55b37e3051baf8d40dfc407f47ce 100644
--- a/python/test/dune/perftool/generation/CMakeLists.txt
+++ b/python/test/dune/perftool/generation/CMakeLists.txt
@@ -1,3 +1,4 @@
-add_python_test_command(COMMAND python -m pytest --pep8
-                        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python/test/dune/perftool/generation
-                        REQUIRED_PACKAGES pytest pytest-pep8)
+dune_python_add_test(NAME pytest
+                     COMMAND ${DUNE_PYTHON_VIRTUALENV_EXECUTABLE} -m pytest --pep8
+                     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python/test/dune/perftool/generation
+                     )