diff --git a/readthedocs/doc_builder/python_environments.py b/readthedocs/doc_builder/python_environments.py index e2e511b3d28..9a2302c41ab 100644 --- a/readthedocs/doc_builder/python_environments.py +++ b/readthedocs/doc_builder/python_environments.py @@ -401,8 +401,9 @@ def install_core_requirements(self): ) pip_cmd = [ - 'python', - self.venv_bin(filename='pip'), + self.venv_bin(filename='python'), + '-m', + 'pip', 'install', '-U', '--cache-dir', diff --git a/readthedocs/rtd_tests/tests/test_doc_building.py b/readthedocs/rtd_tests/tests/test_doc_building.py index 6878a911d1e..6f3b8bc950a 100644 --- a/readthedocs/rtd_tests/tests/test_doc_building.py +++ b/readthedocs/rtd_tests/tests/test_doc_building.py @@ -1330,8 +1330,9 @@ def test_install_core_requirements_sphinx_conda(self, checkout_path): ] args_pip = [ - 'python', - mock.ANY, # pip path + mock.ANY, # python path + '-m', + 'pip', 'install', '-U', '--cache-dir', @@ -1370,8 +1371,9 @@ def test_install_core_requirements_mkdocs_conda(self, checkout_path): ] args_pip = [ - 'python', - mock.ANY, # pip path + mock.ANY, # python path + '-m', + 'pip', 'install', '-U', '--cache-dir',