diff --git a/poetry/console/application.py b/poetry/console/application.py index 42cc4377043..ca9f8c1ace8 100644 --- a/poetry/console/application.py +++ b/poetry/console/application.py @@ -265,7 +265,7 @@ def configure_env( poetry = command.poetry env_manager = EnvManager(poetry) - env = env_manager.create_venv(io) + env = env_manager.create_venv(io, executable=event.io.input.option("use-env")) if env.is_venv() and io.is_verbose(): io.write_line(f"Using virtualenv: {env.path}") @@ -327,6 +327,11 @@ def _default_definition(self) -> "Definition": definition.add_option( Option("--no-plugins", flag=True, description="Disables plugins.") ) + definition.add_option( + Option( + "--use-env", flag=False, description="The python executable to use." + ), + ) return definition