{"record":{"id":"8323bb962e43e910","repo":"astral-sh/uv","slug":"is-already-a-pep-723-script-use-to-exec","errorCode":null,"errorMessage":"`{}` is already a PEP 723 script; use `{}` to execute it","messagePattern":"`(.+?)` is already a PEP 723 script; use `(.+?)` to execute it","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/uv/src/commands/project/init.rs","lineNumber":230,"sourceCode":"    config_discovery: ConfigDiscovery,\n) -> Result<()> {\n    if no_workspace {\n        warn_user_once!(\"`--no-workspace` is a no-op for Python scripts, which are standalone\");\n    }\n    if no_readme {\n        warn_user_once!(\"`--no-readme` is a no-op for Python scripts, which are standalone\");\n    }\n    if author_from.is_some() {\n        warn_user_once!(\"`--author-from` is a no-op for Python scripts, which are standalone\");\n    }\n    let reporter = PythonDownloadReporter::single(printer);\n\n    // If the file already exists, read its content.\n    let content = match fs_err::tokio::read(script_path).await {\n        Ok(metadata) => {\n            // If the file is already a script, raise an error.\n            if ScriptTag::parse(&metadata)?.is_some() {\n                anyhow::bail!(\n                    \"`{}` is already a PEP 723 script; use `{}` to execute it\",\n                    script_path.simplified_display().cyan(),\n                    \"uv run\".green()\n                );\n            }\n\n            Some(metadata)\n        }\n        Err(err) if err.kind() == std::io::ErrorKind::NotFound => None,\n        Err(err) => {\n            return Err(err).with_context(|| {\n                format!(\n                    \"Failed to read script at `{}`\",\n                    script_path.simplified_display().cyan()\n                )\n            });\n        }\n    };","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/project/init.rs#L212-L248","documentation":"Error \"`{}` is already a PEP 723 script; use `{}` to execute it\" thrown in astral-sh/uv.","triggerScenarios":"Thrown at crates/uv/src/commands/project/init.rs:230 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}