diff --git a/colcon_core/task/python/template/sitecustomize.py.em b/colcon_core/task/python/template/sitecustomize.py.em index 5ed6f35ef..bbcd662c8 100644 --- a/colcon_core/task/python/template/sitecustomize.py.em +++ b/colcon_core/task/python/template/sitecustomize.py.em @@ -1,3 +1,4 @@ import sys -sys.real_prefix = sys.prefix -sys.prefix = sys.exec_prefix = @repr(site_prefix) +if sys.prefix == sys.base_prefix: + sys.real_prefix = sys.prefix + sys.prefix = sys.exec_prefix = @repr(site_prefix)