From 3d4d4c36cee259ca02473cf09bec551ea4c01337 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 24 Sep 2017 19:21:27 -0400 Subject: [PATCH] detect virtualenvs better Signed-off-by: Kenneth Reitz --- pipenv/project.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pipenv/project.py b/pipenv/project.py index 679e1252..fd2c39ad 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -74,7 +74,12 @@ class Project(object): def virtualenv_exists(self): # TODO: Decouple project from existence of Pipfile. if self.pipfile_exists: - return os.path.isdir(self.virtualenv_location) + if os.name == 'nt': + extra = ['Scripts', 'activate.bat'] + else: + extra = ['bin', 'activate'] + return os.path.isfile(os.sep.join([self.virtualenv_location] + extra)) + return False @property