diff --git a/crates/uv/src/commands/venv.rs b/crates/uv/src/commands/venv.rs index f96df2b26169..f17a74707305 100644 --- a/crates/uv/src/commands/venv.rs +++ b/crates/uv/src/commands/venv.rs @@ -24,6 +24,7 @@ use uv_fs::Simplified; use uv_interpreter::{find_default_python, find_requested_python, Error}; use uv_resolver::{ExcludeNewer, FlatIndex, InMemoryIndex, OptionsBuilder}; use uv_types::{BuildContext, BuildIsolation, HashStrategy, InFlight}; +use uv_warnings::warn_user; use crate::commands::ExitStatus; use crate::printer::Printer; @@ -120,6 +121,14 @@ async fn venv_impl( find_default_python(cache).into_diagnostic()? }; + // Warn on usage with an unsupported Python version + if interpreter.python_tuple() < (3, 8) { + warn_user!( + "uv is only compatible with Python 3.8+, found Python {}.", + interpreter.python_version() + ); + } + // Add all authenticated sources to the cache. for url in index_locations.urls() { store_credentials_from_url(url);