<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Uv on 风中飞舞</title><link>https://blog.perillaroc.wang/tags/uv/</link><description>Recent content in Uv on 风中飞舞</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Thu, 03 Sep 2026 20:29:21 +0800</lastBuildDate><atom:link href="https://blog.perillaroc.wang/tags/uv/index.xml" rel="self" type="application/rss+xml"/><item><title>HPC使用uv管理Python环境</title><link>https://blog.perillaroc.wang/post/2026/09/2026-09-03-hpc-use-uv-to-manage-python/</link><pubDate>Thu, 03 Sep 2026 20:29:00 +0800</pubDate><guid>https://blog.perillaroc.wang/post/2026/09/2026-09-03-hpc-use-uv-to-manage-python/</guid><description>&lt;h2 id="背景"&gt;背景&lt;/h2&gt;
&lt;p&gt;当前数值预报模式业务系统中越来越多使用 Python 脚本，准备合适的 Python 环境成为部署业务系统必须要考虑的环节。
因 Anaconda 商用必须授权，CMA-HPC2023 不再提供官方支持的 conda 环境，导致缺少统一的自定义 Python 虚拟环境工具。
虽然可以自行安装没有合规风险的 &lt;a href="https://github.com/conda-forge/miniforge"&gt;miniforge&lt;/a&gt; 来创建 conda 环境，但因为 CMA-HPC2023 只能访问内网而没法直接利用 conda 来创建 env。
不过，CMA 内网提供 pypi 同步镜像，可以在 CMA-HPC2023 环境中访问，所以可以利用 uv 工具创建 python 虚拟环境。&lt;/p&gt;
&lt;div class="callout" data-callout="info"&gt;
&lt;div class="callout-title"&gt;
&lt;div class="callout-icon"&gt;&lt;svg class="svg-icon" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"&gt;&lt;circle cx="12" cy="12" r="10"/&gt;&lt;path d="M12 16v-4"/&gt;&lt;path d="M12 8h.01"/&gt;&lt;/svg&gt;&lt;/div&gt;
&lt;div class="callout-title-inner"&gt;Info&lt;/div&gt;
&lt;/div&gt;
&lt;div class="callout-content"&gt;&lt;p&gt;CMA-HPC2023 在 sc1 通过 modulefile 提供 Python 3.10 环境 (业务脚本原因)，在 sc3 则提供系统默认的 Python 3.6 环境。&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;本文介绍如何在 HPC 中使用 uv 管理 Python 环境。&lt;/p&gt;
&lt;h2 id="安装"&gt;安装&lt;/h2&gt;
&lt;h3 id="安装-uv"&gt;安装 uv&lt;/h3&gt;
&lt;p&gt;从 Github 下载 uv 安装包，网址 &lt;a href="https://github.com/astral-sh/uv/releases"&gt;https://github.com/astral-sh/uv/releases&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>