diff --git a/asv/plugins/conda.py b/asv/plugins/conda.py index d7ee3a973..c7628d967 100644 --- a/asv/plugins/conda.py +++ b/asv/plugins/conda.py @@ -14,6 +14,9 @@ from .. import util +WIN = (os.name == "nt") + + class Conda(environment.Environment): """ Manage an environment using conda. @@ -120,8 +123,16 @@ def _install_requirements(self): self._run_executable('conda', args) def _run_executable(self, executable, args, **kwargs): - return util.check_output([ - os.path.join(self._path, 'bin', executable)] + args, **kwargs) + if WIN: + executable += ".exe" + + exe = os.path.join(self._path, 'bin', executable) + if WIN and not os.path.isfile(exe): + exe = os.path.join(self._path, 'Scripts', executable) + if not os.path.isfile(exe): + exe = os.path.join(self._path, executable) + + return util.check_output([exe] + args, **kwargs) def install(self, package): log.info("Installing into {0}".format(self.name)) diff --git a/asv/plugins/virtualenv.py b/asv/plugins/virtualenv.py index 857512d83..2e61cae78 100644 --- a/asv/plugins/virtualenv.py +++ b/asv/plugins/virtualenv.py @@ -141,9 +141,15 @@ def _install_requirements(self): self._run_executable('pip', args) def _run_executable(self, executable, args, **kwargs): + if WIN: + executable += ".exe" + exe = os.path.join(self._path, 'bin', executable) if WIN and not os.path.isfile(exe): - exe = os.path.join(self._path, 'Scripts', executable + '.exe') + exe = os.path.join(self._path, 'Scripts', executable) + if not os.path.isfile(exe): + exe = os.path.join(self._path, executable) + return util.check_output([exe] + args, **kwargs) def install(self, package):