From 54b2733ad8b5807fdae1267c5475d4a0fba38237 Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Wed, 21 Dec 2016 08:17:40 +0000 Subject: [PATCH] Dont run with VIRTUAL_ENV set debian ships a modified site.py which has some interesting behavior when VIRTUAL_ENV is set. In this case it will add /usr/lib/pythonx.x/site-packages to the start of sys.path. This causes pip to install packages to this location (rather than /usr/local). As a result, later on when booting where VIRTUAL_ENV is not set this branch is not hit and the path where python packages were installed is not part of sys.path. Change-Id: Icdb769541eee9793f261b4b8ec563be76ee13fe2 --- lib/img-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/img-functions b/lib/img-functions index 6ba0dfe4..d803cc81 100644 --- a/lib/img-functions +++ b/lib/img-functions @@ -63,7 +63,7 @@ function run_in_target () { # Bug: #1330290 # Force the inclusion of a typical set of dirs in PATH, this is needed for guest # distros that have path elements not in the host PATH. - sudo -E chroot $TMP_MOUNT_PATH env -u TMPDIR PATH="\$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" sh -c "$cmd" + sudo -E chroot $TMP_MOUNT_PATH env -u TMPDIR -u VIRTUAL_ENV PATH="\$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" sh -c "$cmd" export HOME=$ORIG_HOME }