From fdcc6ac367e5fbcf6d66a0c6caa62b043f78fb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 30 Sep 2015 14:25:06 +0200 Subject: [PATCH] PMGR: Only add --user flag if not running in a virtual env --- src/octoprint/util/pip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/util/pip.py b/src/octoprint/util/pip.py index ded4a419..1a590b1c 100644 --- a/src/octoprint/util/pip.py +++ b/src/octoprint/util/pip.py @@ -140,7 +140,7 @@ class PipCaller(CommandlineCaller): self._logger.debug("Virtual environment detected, removing --user flag.") arg_list.remove("--user") # otherwise add it if necessary - elif (self.use_user or self.force_user) and site.ENABLE_USER_SITE: + elif not self._virtual_env and site.ENABLE_USER_SITE and (self.use_user or self.force_user): self._logger.debug("pip needs --user flag for installations.") arg_list.append("--user")