{"id":662,"date":"2026-06-10T11:36:21","date_gmt":"2026-06-10T03:36:21","guid":{"rendered":"https:\/\/blog.zhouhonghe.com\/?p=662"},"modified":"2026-06-10T11:36:21","modified_gmt":"2026-06-10T03:36:21","slug":"uv%e7%ae%80%e6%98%8e%e7%94%a8%e6%b3%95","status":"publish","type":"post","link":"https:\/\/blog.zhouhonghe.com\/?p=662","title":{"rendered":"UV\u7b80\u660e\u7528\u6cd5"},"content":{"rendered":"<p><strong># 1. \u5b89\u88c5 uv<\/strong><br \/>\ncurl -LsSf https:\/\/astral.sh\/uv\/install.sh | sh<\/p>\n<p><strong># 2. \u786e\u4fdd PATH \u751f\u6548\uff08\u901a\u5e38\u4f1a\u81ea\u52a8\u5199\u5165 ~\/.bashrc\uff09<\/strong><br \/>\necho 'export PATH=\"$HOME\/.local\/bin:$PATH\"' >> ~\/.bashrc<br \/>\nsource ~\/.bashrc<\/p>\n<p><strong># 3. \u9a8c\u8bc1<\/strong><br \/>\nuv --version<\/p>\n<p><strong># \u67e5\u770b\u53ef\u5b89\u88c5\u7684python\u7248\u672c<\/strong><br \/>\nuv python list<\/p>\n<p><strong># \u5b89\u88c5\u7279\u5b9a\u7248\u672cpython<\/strong><br \/>\nuv python install 3.12<\/p>\n<p><strong># \u67e5\u770b\u5df2\u5b89\u88c5\u7248\u672c<\/strong><br \/>\nuv python list --only-installed<\/p>\n<p><strong># \u521b\u5efa\u865a\u62df\u73af\u5883<\/strong><br \/>\ncd \/path\/to\/destination<br \/>\nuv venv --python 3.12 .venv<\/p>\n<p><strong># \u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/strong><br \/>\nsource \/path\/to\/destination\/.venv\/bin\/activate<\/p>\n<p><strong># \u5b89\u88c5\u7279\u5b9apython\u5e93<\/strong><br \/>\nuv pip install flask<\/p>\n<p>uv pip install --no-deps -e .  # \u5b89\u88c5\u9879\u76ee\u672c\u8eab<br \/>\nuv sync --no-dev<\/p>\n","protected":false},"excerpt":{"rendered":"<p># 1. \u5b89\u88c5 uv curl -LsSf https:\/\/astral.sh\/uv\/install.sh | [&hellip;]<\/p>... ","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-662","post","type-post","status-publish","format-standard","hentry","category-others"],"_links":{"self":[{"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/posts\/662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=662"}],"version-history":[{"count":3,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/posts\/662\/revisions"}],"predecessor-version":[{"id":665,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=\/wp\/v2\/posts\/662\/revisions\/665"}],"wp:attachment":[{"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zhouhonghe.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}