diff --git a/cmake_support/CopyDependencies.cmake b/cmake_support/CopyDependencies.cmake
index 85ba58729b5ba15f4e0bb312da6b72d41147d22b..ddbf1ae2b39cd2b85231133e306a60f0bc32e5ea 100644
--- a/cmake_support/CopyDependencies.cmake
+++ b/cmake_support/CopyDependencies.cmake
@@ -983,8 +983,10 @@ function(copy_python include_path version new_binary_path)
   if (_UBUNTU_LAYOUT)
     file (GLOB_RECURSE python_lib_files RELATIVE ${python_root_dir}/${LIB_DIR}/python${version}/ FOLLOW_SYMLINKS ${python_root_dir}/${LIB_DIR}/python${version}/*)
     foreach(python_lib_file ${python_lib_files})
-      get_filename_component(real_python_lib_file ${python_root_dir}/${LIB_DIR}/python${version}/${python_lib_file} REALPATH)
-      execute_process(COMMAND cmake -E copy ${real_python_lib_file} ${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/python${version}/${python_lib_file})
+      if(NOT ${python_lib_file} MATCHES "pyc$") 
+        get_filename_component(real_python_lib_file ${python_root_dir}/${LIB_DIR}/python${version}/${python_lib_file} REALPATH)
+        execute_process(COMMAND cmake -E copy ${real_python_lib_file} ${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/python${version}/${python_lib_file})
+      endif()
     endforeach()
   else()
     file(COPY ${python_root_dir}/${LIB_DIR}/python${version}/ DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/python${version} PATTERN "*.pyc" EXCLUDE)