diff --git a/asv/environment.py b/asv/environment.py index 7d8911a41..43f396616 100644 --- a/asv/environment.py +++ b/asv/environment.py @@ -660,8 +660,10 @@ def _install_project(self, repo, commit_hash, build_dir): """ cmd = self._install_command if cmd is None: - # Run pip via python -m pip, avoids shebang length limit on Linux - cmd = ["python -mpip install {wheel_file}"] + # Run pip via python -m pip, avoids shebang length limit on Linux. + # Ensure --force-reinstall so that package being present e.g. on cwd + # does not mess things up. + cmd = ["python -mpip install --force-reinstall {wheel_file}"] if cmd: commit_name = repo.get_decorated_hash(commit_hash, 8) diff --git a/docs/source/asv.conf.json.rst b/docs/source/asv.conf.json.rst index 12f97a81d..b55b7f8f5 100644 --- a/docs/source/asv.conf.json.rst +++ b/docs/source/asv.conf.json.rst @@ -66,7 +66,7 @@ Airspeed Velocity rebuilds the project as needed, using these commands. The defaults are:: "install_command": - ["python -mpip install {wheel_file}"], + ["python -mpip install --force-reinstall {wheel_file}"], "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],