--- dlib/cmake_utils/add_python_module
+++ dlib/cmake_utils/add_python_module
@@ -35,45 +35,15 @@
 list(APPEND CMAKE_PREFIX_PATH "${PYTHON_PATH}")
 
 
-# To avoid dll hell, always link everything statically when compiling in
-# visual studio.  This way, the resulting library won't depend on a bunch
-# of other dll files and can be safely copied to someone elese's computer
-# and expected to run.
-if (MSVC)
-    include(${CMAKE_CURRENT_LIST_DIR}/tell_visual_studio_to_use_static_runtime.cmake)
-    add_definitions(-DBOOST_PYTHON_STATIC_LIB)
-    SET(Boost_USE_STATIC_LIBS ON)
-    SET(Boost_USE_MULTITHREADED ON)
-    SET(Boost_USE_STATIC_RUNTIME ON)
-endif()
-
-set(Boost_NO_BOOST_CMAKE ON)
-
 if (NOT WIN32)
     set(BOOST_LIBRARYDIR ${BOOST_LIBRARYDIR} $ENV{BOOST_LIBRARYDIR}  
             /usr/lib/x86_64-linux-gnu/)
 else()
     link_directories($ENV{BOOST_LIBRARYDIR})
 endif()
-if (PYTHON3)
-    # On some systems the boost python3 module is called python-py34 so check
-    # for that one first.  
-    FIND_PACKAGE(Boost 1.41.0  COMPONENTS python-py34 )
-    if (NOT Boost_FOUND)
-        FIND_PACKAGE(Boost 1.41.0 COMPONENTS python-py35)
-    endif()
-    if (NOT Boost_FOUND)
-        FIND_PACKAGE(Boost 1.41.0 COMPONENTS python3)
-    endif()
-    if (NOT Boost_FOUND)
-        FIND_PACKAGE(Boost 1.41.0 COMPONENTS python)
-    endif()
-    set(Python_ADDITIONAL_VERSIONS 3.5 3.6)
-    FIND_PACKAGE(PythonLibs 3.4)
-else()
-    FIND_PACKAGE(Boost 1.41.0 COMPONENTS python)
-    FIND_PACKAGE(PythonLibs 2.6)
-endif()
+
+FIND_PACKAGE(Boost 1.41.0 COMPONENTS python3)
+FIND_PACKAGE(PythonLibs $ENV{PY_VER} REQUIRED)
 
 if (CMAKE_COMPILER_IS_GNUCXX)
     # Just setting CMAKE_POSITION_INDEPENDENT_CODE should be enough to set
