
{"id":4951,"date":"2025-03-16T23:18:14","date_gmt":"2025-03-16T15:18:14","guid":{"rendered":"https:\/\/infernews.com\/?p=4951"},"modified":"2025-03-16T23:18:16","modified_gmt":"2025-03-16T15:18:16","slug":"python-uv-%e5%8f%96%e4%bb%a3-pip","status":"publish","type":"post","link":"https:\/\/infernews.com\/blog\/python-uv-%e5%8f%96%e4%bb%a3-pip\/","title":{"rendered":"Python UV \u53d6\u4ee3 pip"},"content":{"rendered":"\n<p>Python UV \u662f\u4e00\u500b\u4ee5 Rust\uff0c\u7de8\u5beb\u7684\u9ad8\u6548\u80fd Python \u5957\u4ef6\u7ba1\u7406\u5668\u548c\u5b89\u88dd\u7a0b\u5f0f\u3002\u5b83\u80fd\u5920\u7c21\u5316 Python \u7684\u958b\u767c\uff0c\u540c\u6642\u8ca0\u8cac\u7ba1\u7406\u6a19\u6e96\u51fd\u5f0f\u5eab(Standard Library)\uff0c\u6216\u8005\u5b89\u88dd\u865b\u64ec\u74b0\u5883\u7b49\u7b49\u3002\u5f71\u7247\u8a73\u7d30\u8b1b\u89e3\u4e86\u9ede\u6a23\u5229\u7528 UV \u9032\u884c\u5b8c\u6574\u7684\u958b\u767c\u6d41\u7a0b\uff0c\u4e26\u4e14\u5f37\u8abf UV \u5728\u7c21\u5316\u548c\u7d71\u4e00\u958b\u767c\u74b0\u5883\u65b9\u9762\u7684\u512a\u52e2\u3002<\/p>\n\n\n\n<figure class=\"wp-block-audio\"><audio controls src=\"\/blog\/wp-content\/uploads\/2025\/03\/1742138128266701013-248157475160324.mp3\"><\/audio><\/figure>\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"lyte-wrapper\" title=\"\u7528uv\u7ba1\u7406Python\u7684\u4e00\u5207\uff01\" style=\"width:853px;max-width:100%;margin:5px auto;\"><div class=\"lyMe\" id=\"WYL_aVXs8lb7i9U\" itemprop=\"video\" itemscope itemtype=\"https:\/\/schema.org\/VideoObject\"><div><meta itemprop=\"thumbnailUrl\" content=\"https:\/\/infernews.com\/blog\/wp-content\/plugins\/wp-youtube-lyte\/lyteCache.php?origThumbUrl=https%3A%2F%2Fi.ytimg.com%2Fvi%2FaVXs8lb7i9U%2Fhqdefault.jpg\" \/><meta itemprop=\"embedURL\" content=\"https:\/\/www.youtube.com\/embed\/aVXs8lb7i9U\" \/><meta itemprop=\"duration\" content=\"PT9M17S\" \/><meta itemprop=\"uploadDate\" content=\"2025-03-06T09:00:05Z\" \/><\/div><div id=\"lyte_aVXs8lb7i9U\" data-src=\"https:\/\/infernews.com\/blog\/wp-content\/plugins\/wp-youtube-lyte\/lyteCache.php?origThumbUrl=https%3A%2F%2Fi.ytimg.com%2Fvi%2FaVXs8lb7i9U%2Fhqdefault.jpg\" class=\"pL\"><div class=\"tC\"><div class=\"tT\" itemprop=\"name\">\u7528uv\u7ba1\u7406Python\u7684\u4e00\u5207\uff01<\/div><\/div><div class=\"play\"><\/div><div class=\"ctrl\"><div class=\"Lctrl\"><\/div><div class=\"Rctrl\"><\/div><\/div><\/div><noscript><a href=\"https:\/\/youtu.be\/aVXs8lb7i9U\" rel=\"nofollow\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/infernews.com\/blog\/wp-content\/plugins\/wp-youtube-lyte\/lyteCache.php?origThumbUrl=https%3A%2F%2Fi.ytimg.com%2Fvi%2FaVXs8lb7i9U%2F0.jpg\" alt=\"\u7528uv\u7ba1\u7406Python\u7684\u4e00\u5207\uff01\" width=\"853\" height=\"460\" \/><br \/>Watch this video on YouTube<\/a><\/noscript><meta itemprop=\"description\" content=\"uv python list \u2014 \u5217\u51fauv\u652f\u6301\u7684python\u7248\u672c uv python install cpython3.12 \u2014 \u5b89\u88c5\u67d0\u4e2apython\u7248\u672c (3.12) uv run -p 3.12 xxx.py \u2014 \u4f7f\u7528\u7279\u5b9a\u7248\u672cpython\u8fd0\u884cxxx.py uv run -p 3.12 python \u2014 \u8fd0\u884cpython\u4ea4\u4e92\u754c\u9762 uv run xxx.py\u2014 \u4f7f\u7528\u7cfb\u7edfpython\u6216\u5f53\u524d\u5de5\u7a0b\u7684\u865a\u62df\u73af\u5883\u8fd0\u884cxxx.py uv init \u2014 \u521b\u5efa\u5de5\u7a0b uv add pydantic_ai \u2014 \u6dfb\u52a0\u4f9d\u8d56 (pydantic_ai) uv tree \u2014 \u6253\u5370\u4f9d\u8d56\u6811 uv remove pydantic_ai \u2014 \u5220\u9664\u4f9d\u8d56 uv build \u2014 \u7f16\u8bd1\u5de5\u7a0b sample code: https:\/\/gist.github.com\/cradiator\/b486a3148be3ab63ae7d0c5376fcf783 \u6642\u9593\u8ef8 00:00 \u4ecb\u7d39 01:12 \u793a\u4f8b\u4ee3\u78bc 01:36 \u7ba1\u7406Python 03:27 \u7ba1\u7406\u4f9d\u8cf4 05:28 \u5b89\u88dd\u5de5\u5177 07:16 \u6253\u5305\"><\/div><\/div><div class=\"lL\" style=\"max-width:100%;width:853px;margin:5px auto;\"><\/div><figcaption><\/figcaption><\/figure>","protected":false},"excerpt":{"rendered":"<p>Python UV \u662f\u4e00\u500b\u4ee5 Rust\uff0c\u7de8\u5beb\u7684\u9ad8\u6548\u80fd Python \u5957\u4ef6\u7ba1\u7406\u5668\u548c\u5b89\u88dd\u7a0b\u5f0f\u3002\u5b83\u80fd\u5920\u7c21\u5316 Python \u7684\u958b\u767c\uff0c\u540c\u6642\u8ca0\u8cac\u7ba1\u7406\u6a19\u6e96\u51fd\u5f0f\u5eab(Standard Library)\uff0c\u6216\u8005\u5b89\u88dd\u865b\u64ec\u74b0\u5883\u7b49\u7b49\u3002\u5f71\u7247\u8a73\u7d30\u8b1b\u89e3\u4e86\u9ede\u6a23\u5229\u7528 UV \u9032\u884c\u5b8c\u6574\u7684\u958b\u767c\u6d41\u7a0b\uff0c\u4e26\u4e14\u5f37\u8abf UV \u5728\u7c21\u5316\u548c\u7d71\u4e00\u958b\u767c\u74b0\u5883\u65b9\u9762\u7684\u512a\u52e2\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowvqSiDA:productID":"","footnotes":""},"categories":[38,152],"tags":[],"class_list":["post-4951","post","type-post","status-publish","format-standard","hentry","category-38","category-python"],"_links":{"self":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/posts\/4951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/comments?post=4951"}],"version-history":[{"count":0,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/posts\/4951\/revisions"}],"wp:attachment":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/media?parent=4951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/categories?post=4951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/tags?post=4951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}