<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Doiiars Blog</title>
        <link>https://doiiars.com/</link>
        <description>Doiiars的博客，分享有关ChatGPT、Docker、Python、机器人和有关读书阅读的内容。</description>
        <lastBuildDate>Mon, 26 Oct 2026 09:27:53 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2026, Doiiars</copyright>
        <item>
            <title><![CDATA[Doiiars STOCK MCP 配置及工具推荐提示词]]></title>
            <link>https://doiiars.com/article/doiiars-stock-mcp-tools</link>
            <guid>https://doiiars.com/article/doiiars-stock-mcp-tools</guid>
            <pubDate>Wed, 19 Nov 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Doiiars STOCK MCP 工具推荐提示词 用于全面支持Doiiars的工具使用]]></description>
            <content:encoded><![CDATA[Doiiars STOCK MCP 工具推荐提示词 用于全面支持Doiiars的工具使用]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[akshare 代理配置完整指南]]></title>
            <link>https://doiiars.com/article/akshare-proxy-config-guide</link>
            <guid>https://doiiars.com/article/akshare-proxy-config-guide</guid>
            <pubDate>Sat, 11 Oct 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[本文从底层原理讲解如何为akshare这种量化交易工具配置代理，极易迁移到其他场景。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-2899860c56ab80579af5c6e686dd43a6"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2899860c56ab8036b49bdcc884f449d1" data-id="2899860c56ab8036b49bdcc884f449d1"><span><div id="2899860c56ab8036b49bdcc884f449d1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab8036b49bdcc884f449d1" title="一、akshare 的网络依赖"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">一、akshare 的网络依赖</span></span></h3><div class="notion-text notion-block-2899860c56ab8088bc05f80849ac8761">akshare 的核心网络库依赖：</div><div class="notion-text notion-block-2899860c56ab80bc8026c62eeec8561d"><b>关键问题：</b></div><ul class="notion-list notion-list-disc notion-block-2899860c56ab8083888cf6c6decd10d5"><li><code class="notion-inline-code">requests</code> 默认读取 <code class="notion-inline-code">HTTP_PROXY</code> 环境变量 ✓</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab807f940ff64ce7d2795e"><li><code class="notion-inline-code">aiohttp</code> 默认 <b>不读取</b> 环境变量 ✗</li></ul><div class="notion-text notion-block-2899860c56ab80d0a0e8f6966afdbf1b">这导致仅设置环境变量，akshare 的异步接口可能无法走代理。</div><hr class="notion-hr notion-block-2899860c56ab8031bff8ea98ee75a34c"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2899860c56ab80f78d2fd9d46dd3e5c9" data-id="2899860c56ab80f78d2fd9d46dd3e5c9"><span><div id="2899860c56ab80f78d2fd9d46dd3e5c9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80f78d2fd9d46dd3e5c9" title="二、分步配置策略"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">二、分步配置策略</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2899860c56ab800796cec8a1c9bace0e" data-id="2899860c56ab800796cec8a1c9bace0e"><span><div id="2899860c56ab800796cec8a1c9bace0e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab800796cec8a1c9bace0e" title="2.1 针对 requests 部分（环境变量即可）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.1 针对 requests 部分（环境变量即可）</span></span></h4><div class="notion-text notion-block-2899860c56ab80cead67c410a94934fa">akshare 中使用 <code class="notion-inline-code">requests</code> 的接口，只需设置环境变量：</div><div class="notion-text notion-block-2899860c56ab809ab0cdf2674edfd4a3"><b>Windows 系统设置环境变量：</b></div><div class="notion-text notion-block-2899860c56ab80959b36f9eb56f7c2f8"><b>Linux/Mac 系统：</b></div><div class="notion-text notion-block-2899860c56ab80d39f1aea420e90b4ca"><b>验证是否生效：</b></div><hr class="notion-hr notion-block-2899860c56ab80dc81fac70e0d012800"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2899860c56ab809a80ded8c015a33fa9" data-id="2899860c56ab809a80ded8c015a33fa9"><span><div id="2899860c56ab809a80ded8c015a33fa9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab809a80ded8c015a33fa9" title="2.2 针对 aiohttp 部分（需要额外配置）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.2 针对 aiohttp 部分（需要额外配置）</span></span></h4><div class="notion-text notion-block-2899860c56ab80f498a4e585be0cc92b">如果 akshare 的某些接口使用了 <code class="notion-inline-code">aiohttp</code>，仅设置环境变量不够，需要以下方案。</div><hr class="notion-hr notion-block-2899860c56ab808f815ed246a19dd48d"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2899860c56ab80a08c54c094c9f610d6" data-id="2899860c56ab80a08c54c094c9f610d6"><span><div id="2899860c56ab80a08c54c094c9f610d6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80a08c54c094c9f610d6" title="三、完整解决方案"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三、完整解决方案</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2899860c56ab808cb4bee28e35918ea2" data-id="2899860c56ab808cb4bee28e35918ea2"><span><div id="2899860c56ab808cb4bee28e35918ea2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab808cb4bee28e35918ea2" title="方案 1：Monkey-patch aiohttp（最简单）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">方案 1：Monkey-patch aiohttp（最简单）</span></span></h4><div class="notion-text notion-block-2899860c56ab807db209ccf47c3fbeb9"><b>原理：</b> 在导入 akshare 前，修改 aiohttp 的默认行为。</div><div class="notion-text notion-block-2899860c56ab80058b23fa8161e84459"><b>优点：</b> 5 行代码，无需修改源码，对 requests 和 aiohttp 都生效。</div><hr class="notion-hr notion-block-2899860c56ab80b293f6e7633a8d19e6"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2899860c56ab80fbaa84ea58e2ec5460" data-id="2899860c56ab80fbaa84ea58e2ec5460"><span><div id="2899860c56ab80fbaa84ea58e2ec5460" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80fbaa84ea58e2ec5460" title="方案 2：PySocks 全局代理"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">方案 2：PySocks 全局代理</span></span></h4><div class="notion-text notion-block-2899860c56ab80dd8fcaf17afeff4e6a"><b>原理：</b> 直接代理 Python 的 socket 层，所有网络库自动生效。</div><div class="notion-text notion-block-2899860c56ab80e38c44c42e77efcf7d"><b>安装：</b> <code class="notion-inline-code">pip install PySocks</code></div><div class="notion-text notion-block-2899860c56ab806185a7cfe3bc296295"><b>优点：</b> 最底层方案，对所有网络库生效。</div><hr class="notion-hr notion-block-2899860c56ab803a8272f093b93cd0e2"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2899860c56ab80e198faf970429cf06f" data-id="2899860c56ab80e198faf970429cf06f"><span><div id="2899860c56ab80e198faf970429cf06f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80e198faf970429cf06f" title="方案 3：系统级代理工具"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">方案 3：系统级代理工具</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2899860c56ab8080979deb96de6b77bb" data-id="2899860c56ab8080979deb96de6b77bb"><span><div id="2899860c56ab8080979deb96de6b77bb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab8080979deb96de6b77bb" title="Linux/Mac: proxychains"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Linux/Mac: proxychains</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2899860c56ab8099a371ecfe53b889a1" data-id="2899860c56ab8099a371ecfe53b889a1"><span><div id="2899860c56ab8099a371ecfe53b889a1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab8099a371ecfe53b889a1" title="Windows: Proxifier"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Windows: Proxifier</span></span></h4><div class="notion-text notion-block-2899860c56ab80b4a144f3f332ee758f">图形化工具，设置规则后所有程序自动走代理。</div><div class="notion-text notion-block-2899860c56ab80db8c54deed70fa9533"><b>优点：</b> 无需改代码，适合频繁切换代理。</div><hr class="notion-hr notion-block-2899860c56ab80968164e47ed1fe3210"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2899860c56ab80e0bd48d4041a97ddde" data-id="2899860c56ab80e0bd48d4041a97ddde"><span><div id="2899860c56ab80e0bd48d4041a97ddde" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80e0bd48d4041a97ddde" title="三、网络原理深入"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三、网络原理深入</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2899860c56ab803f88b1e4d4a1069079" data-id="2899860c56ab803f88b1e4d4a1069079"><span><div id="2899860c56ab803f88b1e4d4a1069079" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab803f88b1e4d4a1069079" title="3.1 网络请求的层次结构"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.1 网络请求的层次结构</span></span></h4><div class="notion-text notion-block-2899860c56ab80e68b76ce0a5f745a82"><b>代理可以在任一层实现：</b></div><table class="notion-simple-table notion-block-2899860c56ab807691fdd55d8ac9ea12"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-2899860c56ab80c5a499c47eaebc5bc1"><td class="" style="width:120px"><div class="notion-simple-table-cell">层次</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">方案</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">优点</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">缺点</div></td></tr><tr class="notion-simple-table-row notion-block-2899860c56ab8015a6dfc95ebe46f7cd"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>应用层</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">修改 akshare 源码</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">精确控制</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">需要维护代码</div></td></tr><tr class="notion-simple-table-row notion-block-2899860c56ab80afbed3f7bcf54445b7"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>HTTP 库层</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">环境变量 + trust_env</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">标准做法</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">aiohttp 需要额外设置</div></td></tr><tr class="notion-simple-table-row notion-block-2899860c56ab800780b3cd675a1e8c90"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>Socket 层</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">PySocks</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">全局生效</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">可能影响其他程序</div></td></tr><tr class="notion-simple-table-row notion-block-2899860c56ab8011bc5edb4131647f33"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>系统层</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">proxychains / Proxifier</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">透明代理</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">依赖外部工具</div></td></tr></tbody></table><hr class="notion-hr notion-block-2899860c56ab801d8aaefc92519c8ac1"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2899860c56ab8005a275fe32786a2ec6" data-id="2899860c56ab8005a275fe32786a2ec6"><span><div id="2899860c56ab8005a275fe32786a2ec6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab8005a275fe32786a2ec6" title="3.2 为什么 aiohttp 默认不信任环境变量？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2 为什么 aiohttp 默认不信任环境变量？</span></span></h4><div class="notion-text notion-block-2899860c56ab8095a1d5df53901e7df0"><b>历史原因：</b> aiohttp 设计之初，<code class="notion-inline-code">trust_env=False</code> 是为了：</div><ol start="1" class="notion-list notion-list-numbered notion-block-2899860c56ab8041a64cd0f9c3f69922" style="list-style-type:decimal"><li>避免意外的代理行为</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-2899860c56ab80f3abbbe00c14347603" style="list-style-type:decimal"><li>更明确的配置方式</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-2899860c56ab80b4a16ac5aabc805167" style="list-style-type:decimal"><li>安全考虑（防止环境变量污染）</li></ol><div class="notion-text notion-block-2899860c56ab80dfbd11db4d30959457">但这与 <code class="notion-inline-code">requests</code>、<code class="notion-inline-code">httpx</code> 等库的默认行为不一致，导致用户困惑。</div><div class="notion-text notion-block-2899860c56ab80748384f028e5a3e786"><b>社区讨论：</b> <a class="notion-link" href="https://github.com/aio-libs/aiohttp/issues/10682" target="_blank" rel="noopener noreferrer">aiohttp issue #10682</a> 建议修改默认值为 <code class="notion-inline-code">True</code>，但尚未合并。</div><hr class="notion-hr notion-block-2899860c56ab80979ef0ee78db845a72"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2899860c56ab809cbf69ee87f0de29a3" data-id="2899860c56ab809cbf69ee87f0de29a3"><span><div id="2899860c56ab809cbf69ee87f0de29a3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab809cbf69ee87f0de29a3" title="3.3 Socket 层代理的工作原理"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.3 Socket 层代理的工作原理</span></span></h4><div class="notion-text notion-block-2899860c56ab803ebf36c128dc34c68b"><b>关键优势：</b> 在最底层拦截，对上层透明，无需修改任何代码。</div><hr class="notion-hr notion-block-2899860c56ab80848226ff0a406d885d"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2899860c56ab803e9c8be0ca207e87d1" data-id="2899860c56ab803e9c8be0ca207e87d1"><span><div id="2899860c56ab803e9c8be0ca207e87d1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab803e9c8be0ca207e87d1" title="四、方案选择建议"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">四、方案选择建议</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-2899860c56ab8066b08ffa799c3627e0" data-id="2899860c56ab8066b08ffa799c3627e0"><span><div id="2899860c56ab8066b08ffa799c3627e0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab8066b08ffa799c3627e0" title="决策流程"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">决策流程</span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-2899860c56ab80cab7d2fa524372ddd9" style="list-style-type:decimal"><li><b>先测试环境变量</b>（针对 requests）</li><ol class="notion-list notion-list-numbered notion-block-2899860c56ab80cab7d2fa524372ddd9" style="list-style-type:lower-alpha"><ul class="notion-list notion-list-disc notion-block-2899860c56ab80b7b522debb279317e6"><li>如果 akshare 接口都能正常工作 → 完成 ✓</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab800e8e89ccbe6f485218"><li>如果部分接口超时 → 说明用了 aiohttp，继续下一步</li></ul></ol></ol><ol start="2" class="notion-list notion-list-numbered notion-block-2899860c56ab80d1babdfbc7b5cfbfd4" style="list-style-type:decimal"><li><b>选择 aiohttp 代理方案</b></li></ol><table class="notion-simple-table notion-block-2899860c56ab8006ac3ce8ae715247f8"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-2899860c56ab80dfa274f195fcd2486c"><td class="" style="width:120px"><div class="notion-simple-table-cell">场景</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">推荐方案</div></td></tr><tr class="notion-simple-table-row notion-block-2899860c56ab8083a25ecb753f2b9a39"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>快速测试</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">方案 1（Monkey-patch）</div></td></tr><tr class="notion-simple-table-row notion-block-2899860c56ab80f7a558ecdfa310ed23"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>生产环境</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">方案 2（PySocks）</div></td></tr><tr class="notion-simple-table-row notion-block-2899860c56ab80ff9756e6c501965564"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>本地开发</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">方案 3（系统工具）</div></td></tr><tr class="notion-simple-table-row notion-block-2899860c56ab8057a48ef799fdf832c5"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>Docker 部署</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">环境变量 + Monkey-patch</div></td></tr><tr class="notion-simple-table-row notion-block-2899860c56ab80bfaeecdd3ef91f57a9"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>多项目共用</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">系统级代理</div></td></tr></tbody></table><hr class="notion-hr notion-block-2899860c56ab80ddb141ea912bfd064b"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2899860c56ab80bba874e44043551361" data-id="2899860c56ab80bba874e44043551361"><span><div id="2899860c56ab80bba874e44043551361" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80bba874e44043551361" title="五、验证代理是否生效"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">五、验证代理是否生效</span></span></h3><hr class="notion-hr notion-block-2899860c56ab8082b4b5d8bc06c1f2e0"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-2899860c56ab80a4b5abe79f82a12c37" data-id="2899860c56ab80a4b5abe79f82a12c37"><span><div id="2899860c56ab80a4b5abe79f82a12c37" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80a4b5abe79f82a12c37" title="总结"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">总结</span></span></h3><ol start="1" class="notion-list notion-list-numbered notion-block-2899860c56ab8023958af650b294ea45" style="list-style-type:decimal"><li><b>分步配置：</b></li><ol class="notion-list notion-list-numbered notion-block-2899860c56ab8023958af650b294ea45" style="list-style-type:lower-alpha"><ul class="notion-list notion-list-disc notion-block-2899860c56ab800593bae9b1a4d21158"><li>requests 部分：设置环境变量即可</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab803c9f31cf653f78ade2"><li>aiohttp 部分：需要额外配置</li></ul></ol></ol><ol start="2" class="notion-list notion-list-numbered notion-block-2899860c56ab800092d0e66e36ddad82" style="list-style-type:decimal"><li><b>最简方案：</b> 先测试环境变量，不够再 Monkey-patch</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-2899860c56ab80fcae61d5f09926ca11" style="list-style-type:decimal"><li><b>最彻底方案：</b> PySocks 代理 socket 层，一劳永逸</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-2899860c56ab80e3a323cc6de8dfbb1d" style="list-style-type:decimal"><li><b>原理：</b> 代理可以在网络栈的任一层实现</li></ol><div class="notion-text notion-block-2899860c56ab80eeab59c1916b7d9f78">先简单后复杂，能用环境变量就不用写代码。</div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[基于 UV 的 Python 版本管理]]></title>
            <link>https://doiiars.com/article/uv-python-venv-version-control</link>
            <guid>https://doiiars.com/article/uv-python-venv-version-control</guid>
            <pubDate>Sat, 11 Oct 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[基于uv进行python版本及虚拟环境管理教程。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-2899860c56ab800a8076ec4dc726c925"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-2899860c56ab8056b52fc41a960d6d1c" data-id="2899860c56ab8056b52fc41a960d6d1c"><span><div id="2899860c56ab8056b52fc41a960d6d1c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab8056b52fc41a960d6d1c" title="概念"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">概念</span></span></h2><div class="notion-text notion-block-2899860c56ab8076b2a0e6fea6959105">Python 版本由 Python 解释器（即 <code class="notion-inline-code">python</code> 可执行文件）、标准库和其他支持文件组成。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab80d5a564e3271c08a4d5" data-id="2899860c56ab80d5a564e3271c08a4d5"><span><div id="2899860c56ab80d5a564e3271c08a4d5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80d5a564e3271c08a4d5" title="托管和系统 Python 安装"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">托管和系统 Python 安装</span></span></h3><div class="notion-text notion-block-2899860c56ab80c89208e8c474f7a621">由于系统通常已经安装了 Python,uv 支持发现 Python 版本。但 uv 也支持自己安装 Python 版本。为了区分这两种类型:</div><ul class="notion-list notion-list-disc notion-block-2899860c56ab80c4b7adca7b85912a15"><li><b>托管 Python 安装</b>: uv 安装的 Python 版本</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab808eb814f87489b768ef"><li><b>系统 Python 安装</b>: 其他所有 Python 安装(包括操作系统或其他工具如 pyenv 安装的)</li></ul><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab80a899ecf62204aeaee1" data-id="2899860c56ab80a899ecf62204aeaee1"><span><div id="2899860c56ab80a899ecf62204aeaee1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80a899ecf62204aeaee1" title="请求版本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">请求版本</span></span></h3><div class="notion-text notion-block-2899860c56ab8003a8d3fc72c3fd4fa6">使用 <code class="notion-inline-code">--python</code> 标志请求特定 Python 版本:</div><div class="notion-text notion-block-2899860c56ab805491abff6db4ed2c55">uv 会确保 Python 3.11.6 可用(必要时自动下载安装),然后用它创建虚拟环境。</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-2899860c56ab807ca61ee52f13e03231" data-id="2899860c56ab807ca61ee52f13e03231"><span><div id="2899860c56ab807ca61ee52f13e03231" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab807ca61ee52f13e03231" title="支持的请求格式"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">支持的请求格式</span></span></h4><ul class="notion-list notion-list-disc notion-block-2899860c56ab80eb90c8ecd9bf343bbc"><li><code class="notion-inline-code">&lt;version&gt;</code> (例: 3, 3.12, 3.12.3)</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab80dabca1df0481e81307"><li><code class="notion-inline-code">&lt;version-specifier&gt;</code> (例: &gt;=3.12,&lt;3.13)</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab801ca757c4598b204461"><li><code class="notion-inline-code">&lt;version&gt;&lt;short-variant&gt;</code> (例: 3.13t, 3.12.0d)</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab80319eeae87458690c0b"><li><code class="notion-inline-code">&lt;version&gt;+&lt;variant&gt;</code> (例: 3.13+freethreaded, 3.12.0+debug)</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab801bb8ffdcec29d1bfcb"><li><code class="notion-inline-code">&lt;implementation&gt;</code> (例: cpython 或 cp)</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab80ae9257ce4def47f697"><li><code class="notion-inline-code">&lt;implementation&gt;@&lt;version&gt;</code> (例: cpython@3.12)</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab8072a360f93b171a193e"><li><code class="notion-inline-code">&lt;implementation&gt;&lt;version&gt;</code> (例: cpython3.12 或 cp312)</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab8087854bea568d80f55d"><li><code class="notion-inline-code">&lt;implementation&gt;&lt;version-specifier&gt;</code> (例: cpython&gt;=3.12,&lt;3.13)</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab80e3b0e7d565298e2c77"><li><code class="notion-inline-code">&lt;implementation&gt;-&lt;version&gt;-&lt;os&gt;-&lt;arch&gt;-&lt;libc&gt;</code> (例: cpython-3.12.3-macos-aarch64-none)</li></ul><div class="notion-text notion-block-2899860c56ab8073ad8adf0dec40e3ee">还可以请求特定系统 Python 解释器:</div><ul class="notion-list notion-list-disc notion-block-2899860c56ab807db8f5ec273833687a"><li><code class="notion-inline-code">&lt;executable-path&gt;</code> (例: /opt/homebrew/bin/python3)</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab804aa05af16e0493573d"><li><code class="notion-inline-code">&lt;executable-name&gt;</code> (例: mypython3)</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab80f5b6e5dff9b45199ab"><li><code class="notion-inline-code">&lt;install-dir&gt;</code> (例: /some/environment/)</li></ul><div class="notion-text notion-block-2899860c56ab80d0b2f4d90612fdd87a"><b>提示</b>: 默认情况下,如果系统找不到 Python 版本,uv 会自动下载。可以用 <code class="notion-inline-code">python-downloads</code> 选项禁用此行为。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab8030a63dd47ac02a7fb0" data-id="2899860c56ab8030a63dd47ac02a7fb0"><span><div id="2899860c56ab8030a63dd47ac02a7fb0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab8030a63dd47ac02a7fb0" title="Python 版本文件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Python 版本文件</span></span></h3><div class="notion-text notion-block-2899860c56ab80c591e8d617c3620fa0"><code class="notion-inline-code">.python-version</code> 文件可创建默认的 Python 版本请求。uv 会在工作目录及其父目录中搜索此文件。如果找不到,会检查用户级配置目录。</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-2899860c56ab8008abc2e42611860734" data-id="2899860c56ab8008abc2e42611860734"><span><div id="2899860c56ab8008abc2e42611860734" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab8008abc2e42611860734" title="创建版本文件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">创建版本文件</span></span></h4><div class="notion-text notion-block-2899860c56ab8085a40ddce39e89f99c">使用 <code class="notion-inline-code">--no-config</code> 可禁用 <code class="notion-inline-code">.python-version</code> 文件的发现。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab80109728c76cf6d62601" data-id="2899860c56ab80109728c76cf6d62601"><span><div id="2899860c56ab80109728c76cf6d62601" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80109728c76cf6d62601" title="安装 Python 版本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">安装 Python 版本</span></span></h3><div class="notion-text notion-block-2899860c56ab8027a5fbc8a435dae150">uv 内置了 macOS、Linux 和 Windows 的 CPython 和 PyPy 发行版下载列表。</div><div class="notion-text notion-block-2899860c56ab806f8578c3e72713c831"><b>提示</b>: 默认情况下,Python 版本会根据需要自动下载,无需使用 <code class="notion-inline-code">uv python install</code>。</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-2899860c56ab80a0aff5d2903a456dbd" data-id="2899860c56ab80a0aff5d2903a456dbd"><span><div id="2899860c56ab80a0aff5d2903a456dbd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80a0aff5d2903a456dbd" title="安装示例"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">安装示例</span></span></h4><div class="notion-text notion-block-2899860c56ab80b89f2acf25668ff376"><b>重要</b>: 可用的 Python 版本在每个 uv 版本中固定。要安装新的 Python 版本,可能需要升级 uv。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab80e580b6fee2c4ac62af" data-id="2899860c56ab80e580b6fee2c4ac62af"><span><div id="2899860c56ab80e580b6fee2c4ac62af" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80e580b6fee2c4ac62af" title="安装 Python 可执行文件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">安装 Python 可执行文件</span></span></h3><div class="notion-text notion-block-2899860c56ab8052b5f0d5e5b6066c83">uv 默认将 Python 可执行文件安装到 PATH 中,例如 <code class="notion-inline-code">uv python install 3.12</code> 会将 Python 安装到 <code class="notion-inline-code">~/.local/bin/python3.12</code>。</div><div class="notion-text notion-block-2899860c56ab8086b9ece543faf059cc"><b>提示</b>: 如果 <code class="notion-inline-code">~/.local/bin</code> 不在 PATH 中,可以用 <code class="notion-inline-code">uv tool update-shell</code> 添加。</div><div class="notion-text notion-block-2899860c56ab8094b61cec5e5c51e5dc">安装 <code class="notion-inline-code">python</code> 和 <code class="notion-inline-code">python3</code> 可执行文件:</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab80d9980cc81ff7e01674" data-id="2899860c56ab80d9980cc81ff7e01674"><span><div id="2899860c56ab80d9980cc81ff7e01674" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80d9980cc81ff7e01674" title="升级 Python 版本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">升级 Python 版本</span></span></h3><div class="notion-text notion-block-2899860c56ab8093afdefddbcc3a3f90"><b>重要</b>: Python 版本升级支持处于预览阶段。</div><div class="notion-text notion-block-2899860c56ab8082b883ec852de14b0c">uv 允许透明升级 Python 补丁版本(如 3.13.4 到 3.13.5),但不支持跨次要版本升级(如 3.12 到 3.13)。</div><div class="notion-text notion-block-2899860c56ab800c8d4bfffbb9c036d3">升级后,uv 会优先使用新版本,但会保留旧版本,因为现有虚拟环境可能仍在使用。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab8018a00bfa52744ac384" data-id="2899860c56ab8018a00bfa52744ac384"><span><div id="2899860c56ab8018a00bfa52744ac384" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab8018a00bfa52744ac384" title="项目 Python 版本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">项目 Python 版本</span></span></h3><div class="notion-text notion-block-2899860c56ab806fadcfe6c48ebecaa7">uv 在项目命令调用期间会遵守 <code class="notion-inline-code">pyproject.toml</code> 文件中 <code class="notion-inline-code">requires-python</code> 定义的 Python 要求。将使用与要求兼容的第一个 Python 版本,除非通过 <code class="notion-inline-code">.python-version</code> 文件或 <code class="notion-inline-code">--python</code> 标志另行请求。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab80638c04c2a239deb4ce" data-id="2899860c56ab80638c04c2a239deb4ce"><span><div id="2899860c56ab80638c04c2a239deb4ce" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80638c04c2a239deb4ce" title="查看可用的 Python 版本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">查看可用的 Python 版本</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab80f1ace1cb086a351523" data-id="2899860c56ab80f1ace1cb086a351523"><span><div id="2899860c56ab80f1ace1cb086a351523" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80f1ace1cb086a351523" title="查找 Python 可执行文件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">查找 Python 可执行文件</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab80a6a248e9c530459db6" data-id="2899860c56ab80a6a248e9c530459db6"><span><div id="2899860c56ab80a6a248e9c530459db6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80a6a248e9c530459db6" title="Python 版本发现规则"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Python 版本发现规则</span></span></h3><div class="notion-text notion-block-2899860c56ab8023b431f41596f430ea">搜索 Python 版本时,会按以下顺序检查:</div><ol start="1" class="notion-list notion-list-numbered notion-block-2899860c56ab800b9d06d73a38862351" style="list-style-type:decimal"><li><code class="notion-inline-code">UV_PYTHON_INSTALL_DIR</code> 中的托管 Python 安装</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-2899860c56ab80dcabcbd64094e35c17" style="list-style-type:decimal"><li>PATH 中的 Python 解释器(macOS/Linux: <code class="notion-inline-code">python</code>, <code class="notion-inline-code">python3</code>, <code class="notion-inline-code">python3.x</code>; Windows: <code class="notion-inline-code">python.exe</code>)</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-2899860c56ab804dacefc24c1a887b3f" style="list-style-type:decimal"><li>Windows 注册表和 Microsoft Store 中的 Python 解释器(Windows)</li></ol><div class="notion-text notion-block-2899860c56ab80d4ad61f48b1b1813b5">发现时会跳过非可执行文件。每个发现的可执行文件都会查询元数据以确保满足请求的 Python 版本。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab807db2d5d8196c33d08e" data-id="2899860c56ab807db2d5d8196c33d08e"><span><div id="2899860c56ab807db2d5d8196c33d08e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab807db2d5d8196c33d08e" title="特殊 Python 变体"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">特殊 Python 变体</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-2899860c56ab8013b615d936cd12437b" data-id="2899860c56ab8013b615d936cd12437b"><span><div id="2899860c56ab8013b615d936cd12437b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab8013b615d936cd12437b" title="预发布版本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">预发布版本</span></span></h4><div class="notion-text notion-block-2899860c56ab803c83a2f0925e93ff9e">Python 预发布版本默认不会被选择。只有在没有其他可用安装匹配请求时才会使用。</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-2899860c56ab804294f2fc28d83d4760" data-id="2899860c56ab804294f2fc28d83d4760"><span><div id="2899860c56ab804294f2fc28d83d4760" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab804294f2fc28d83d4760" title="自由线程 Python"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">自由线程 Python</span></span></h4><div class="notion-text notion-block-2899860c56ab80f28491cc0b55e470a4">uv 支持 CPython 3.13+ 中的自由线程 Python 变体。</div><div class="notion-text notion-block-2899860c56ab80d8ad5dc390988cbd84">自由线程 Python 版本默认不会被选择。只有明确请求时才会选择,例如使用 <code class="notion-inline-code">3.13t</code> 或 <code class="notion-inline-code">3.13+freethreaded</code>。</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-2899860c56ab80a8b4f6f70933a221ec" data-id="2899860c56ab80a8b4f6f70933a221ec"><span><div id="2899860c56ab80a8b4f6f70933a221ec" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80a8b4f6f70933a221ec" title="调试 Python 变体"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">调试 Python 变体</span></span></h4><div class="notion-text notion-block-2899860c56ab8048b1f2cfd97268ebb9">uv 支持发现和安装 Python 的调试构建版本。</div><div class="notion-text notion-block-2899860c56ab80acb2e9e29c87818882"><b>重要</b>: Python 的调试构建速度较慢,不适合一般使用。</div><div class="notion-text notion-block-2899860c56ab80e2b1b7cfa50292c134">可以使用 <code class="notion-inline-code">3.13d</code> 或 <code class="notion-inline-code">3.13+debug</code> 明确请求调试构建。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab80cd8883f2d75878c4d7" data-id="2899860c56ab80cd8883f2d75878c4d7"><span><div id="2899860c56ab80cd8883f2d75878c4d7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80cd8883f2d75878c4d7" title="禁用自动 Python 下载"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">禁用自动 Python 下载</span></span></h3><div class="notion-text notion-block-2899860c56ab8047a2e2e44e73ce04c7">默认情况下,uv 会在需要时自动下载 Python 版本。</div><div class="notion-text notion-block-2899860c56ab802397dcccd0d56f48e0"><code class="notion-inline-code">python-downloads</code> 选项可用于禁用此行为。默认设置为 <code class="notion-inline-code">automatic</code>; 设置为 <code class="notion-inline-code">manual</code> 仅允许在 <code class="notion-inline-code">uv python install</code> 期间下载 Python。</div><div class="notion-text notion-block-2899860c56ab80d4ad4fcd723d25d89f"><b>提示</b>: 可以在持久配置文件中设置 <code class="notion-inline-code">python-downloads</code>,或使用 <code class="notion-inline-code">--no-python-downloads</code> 标志。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab8078b931c15428767519" data-id="2899860c56ab8078b931c15428767519"><span><div id="2899860c56ab8078b931c15428767519" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab8078b931c15428767519" title="要求或禁用托管 Python 版本"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">要求或禁用托管 Python 版本</span></span></h3><div class="notion-text notion-block-2899860c56ab80bdbc29cba9310f192c">要在配置文件中更改 uv 的默认行为,请使用 <code class="notion-inline-code">python-preference</code> 设置。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab80f8afc1e6b697c63399" data-id="2899860c56ab80f8afc1e6b697c63399"><span><div id="2899860c56ab80f8afc1e6b697c63399" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80f8afc1e6b697c63399" title="调整 Python 版本偏好"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">调整 Python 版本偏好</span></span></h3><div class="notion-text notion-block-2899860c56ab800ca8f1d1a4e36e2cea"><code class="notion-inline-code">python-preference</code> 设置确定是优先使用系统上已有的 Python 安装,还是 uv 下载安装的。</div><div class="notion-text notion-block-2899860c56ab80fa8680c9b5ccab6639">默认值: <code class="notion-inline-code">managed</code> - 优先使用托管 Python,但仍然优先使用系统 Python 而不是下载新版本。</div><div class="notion-text notion-block-2899860c56ab8063a0a0f185d7184264">其他选项:</div><ul class="notion-list notion-list-disc notion-block-2899860c56ab80e38e93cf62c96ec435"><li><code class="notion-inline-code">only-managed</code>: 仅使用托管 Python 安装</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab807782aafcb9244d6153"><li><code class="notion-inline-code">system</code>: 优先使用系统 Python 安装</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab80dfac37d06b62de31e4"><li><code class="notion-inline-code">only-system</code>: 仅使用系统 Python 安装</li></ul><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab802e81f8ef6f92b859ed" data-id="2899860c56ab802e81f8ef6f92b859ed"><span><div id="2899860c56ab802e81f8ef6f92b859ed" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab802e81f8ef6f92b859ed" title="Python 实现支持"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Python 实现支持</span></span></h3><div class="notion-text notion-block-2899860c56ab8091bbdec355a132937e">uv 支持以下 Python 实现:</div><ul class="notion-list notion-list-disc notion-block-2899860c56ab80e39ad5f25f15f627fd"><li><b>CPython</b>: cpython, cp</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab806fba9bc2a1494c1bf8"><li><b>PyPy</b>: pypy, pp</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab80df9f21e7c85840b5f4"><li><b>GraalPy</b>: graalpy, gp</li></ul><ul class="notion-list notion-list-disc notion-block-2899860c56ab80459eaaec186c3765d0"><li><b>Pyodide</b>: pyodide</li></ul><div class="notion-text notion-block-2899860c56ab8062bc7df956fe4a6500">实现名称请求不区分大小写。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab802cb51bd540ae195c65" data-id="2899860c56ab802cb51bd540ae195c65"><span><div id="2899860c56ab802cb51bd540ae195c65" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab802cb51bd540ae195c65" title="托管 Python 发行版"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">托管 Python 发行版</span></span></h3><div class="notion-text notion-block-2899860c56ab801fae09f59539bee79e">uv 支持下载和安装 CPython、PyPy 和 Pyodide 发行版。</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-2899860c56ab80938e55d90440d9da94" data-id="2899860c56ab80938e55d90440d9da94"><span><div id="2899860c56ab80938e55d90440d9da94" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80938e55d90440d9da94" title="CPython 发行版"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">CPython 发行版</span></span></h4><div class="notion-text notion-block-2899860c56ab80a08686c44eb24507aa">由于 Python 不发布官方的可分发 CPython 二进制文件,uv 使用 Astral <code class="notion-inline-code">python-build-standalone</code> 项目的预构建发行版。这些发行版自包含、高度可移植且高性能。</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-2899860c56ab805dbee0f023708efdac" data-id="2899860c56ab805dbee0f023708efdac"><span><div id="2899860c56ab805dbee0f023708efdac" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab805dbee0f023708efdac" title="PyPy 发行版"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">PyPy 发行版</span></span></h4><div class="notion-text notion-block-2899860c56ab80c39d2ecd00e7f7b580">由 PyPy 项目提供。</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-2899860c56ab80b08815ec7b4b506d7a" data-id="2899860c56ab80b08815ec7b4b506d7a"><span><div id="2899860c56ab80b08815ec7b4b506d7a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80b08815ec7b4b506d7a" title="Pyodide 发行版"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Pyodide 发行版</span></span></h4><div class="notion-text notion-block-2899860c56ab80759d9eda08e8f4464e">由 Pyodide 项目提供。Pyodide 是针对 WebAssembly / Emscripten 平台的 CPython 移植版本。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab80f990d6eb0d8af0d333" data-id="2899860c56ab80f990d6eb0d8af0d333"><span><div id="2899860c56ab80f990d6eb0d8af0d333" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80f990d6eb0d8af0d333" title="aarch64 上的透明 x86_64 仿真"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">aarch64 上的透明 x86_64 仿真</span></span></h3><div class="notion-text notion-block-2899860c56ab800f9963eccd427ceda0">macOS 和 Windows 都支持通过透明仿真在 aarch64 上运行 x86_64 二进制文件(Rosetta 2 或 Windows on ARM)。可以在 aarch64 上使用 x86_64 uv,也可以使用 x86_64 Python 解释器。但 Python 解释器需要其架构的包,要么全部 x86_64,要么全部 aarch64。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2899860c56ab80c5bb95e018240adf91" data-id="2899860c56ab80c5bb95e018240adf91"><span><div id="2899860c56ab80c5bb95e018240adf91" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2899860c56ab80c5bb95e018240adf91" title="Windows 注册表注册"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">Windows 注册表注册</span></span></h3><div class="notion-text notion-block-2899860c56ab8036bd78ed520831fab3">在 Windows 上,安装托管 Python 版本时会按照 PEP 514 的定义在 Windows 注册表中注册。</div><div class="notion-text notion-block-2899860c56ab80559360cce0ceade7ff">安装后,可以使用 py 启动器选择 Python 版本:</div><div class="notion-text notion-block-2899860c56ab8022a2e5fd4a6b9eb667">卸载时,uv 会删除目标版本的注册表项以及任何损坏的注册表项。</div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[国密算法密钥格式对照表]]></title>
            <link>https://doiiars.com/article/sm-crypto-key-formats</link>
            <guid>https://doiiars.com/article/sm-crypto-key-formats</guid>
            <pubDate>Wed, 28 May 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[国密算法密钥格式对照表]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-2019860c56ab807daf3ce4d310203602"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-2019860c56ab80c1b5ecfec14bac67ef" data-id="2019860c56ab80c1b5ecfec14bac67ef"><span><div id="2019860c56ab80c1b5ecfec14bac67ef" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2019860c56ab80c1b5ecfec14bac67ef" title="国密算法密钥格式对照表"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">国密算法密钥格式对照表</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2019860c56ab80f3b502c3c5fc107157" data-id="2019860c56ab80f3b502c3c5fc107157"><span><div id="2019860c56ab80f3b502c3c5fc107157" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2019860c56ab80f3b502c3c5fc107157" title="主要格式"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">主要格式</span></span></h3><table class="notion-simple-table notion-block-2019860c56ab8077895eccc656f5411c"><tbody><tr class="notion-simple-table-row notion-block-2019860c56ab8005836cdadd72d45e15"><td class="" style="width:120px"><div class="notion-simple-table-cell">格式类型</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">描述</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">示例/特点</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">格式特点</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">适用场景</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab80edb062ef06eb996cf8"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>HEX格式</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">十六进制字符串</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">0123456789abcdef...</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">• 只能包含0-9、a-f字符&lt;br&gt;• 没有G及之后的字母&lt;br&gt;• 长度必须为偶数&lt;br&gt;• 大小写不敏感</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">最常用，便于存储传输</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab80afa9fdfbc7f52ad2ef"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>字节数组</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">二进制数组</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">[0x01, 0x23, 0x45, ...]</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">• 每个元素0-255&lt;br&gt;• 直接映射二进制&lt;br&gt;• 无需编码解码</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">程序内部处理</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab8083bdf1c1e13a057391"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>Base64</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Base64编码</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">ASNFZ4mrze8=</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">• 使用A-Z、a-z、0-9、+、/&lt;br&gt;• 可能有=填充符&lt;br&gt;• 长度必须是4的倍数</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">文本传输，URL安全</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab80f2a9e1e63cc18acba7"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>PEM格式</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">ASCII文本格式</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">-----BEGIN PUBLIC KEY-----</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">• 有固定头尾标识&lt;br&gt;• 内容是Base64编码&lt;br&gt;• 每行最多64字符</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">标准证书格式</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab805686bfda9eb3b877f8"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>DER格式</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">二进制编码</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">二进制数据</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">• ASN.1编码规则&lt;br&gt;• 紧凑无冗余&lt;br&gt;• 不可读文本</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">紧凑存储</div></td></tr></tbody></table><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2019860c56ab8021b8b2fad3b28795e1" data-id="2019860c56ab8021b8b2fad3b28795e1"><span><div id="2019860c56ab8021b8b2fad3b28795e1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2019860c56ab8021b8b2fad3b28795e1" title="公钥长度格式"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">公钥长度格式</span></span></h3><table class="notion-simple-table notion-block-2019860c56ab80298ed4f167898b2e3d"><tbody><tr class="notion-simple-table-row notion-block-2019860c56ab804b8c48ce5a644e7c82"><td class="" style="width:120px"><div class="notion-simple-table-cell">格式</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">长度</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">前缀</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">格式特点</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">说明</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab80ee95fec198669dbd2f"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>完整公钥</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">130位</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">04</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">• 包含完整x,y坐标&lt;br&gt;• 固定以04开头&lt;br&gt;• 长度固定130个字符</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">未压缩格式，兼容性最好</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab8023a0b6c6fcc71be18a"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>压缩公钥</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">66位</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">02</code>/<code class="notion-inline-code">03</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">• 只保存x坐标&lt;br&gt;• 02表示y为偶数&lt;br&gt;• 03表示y为奇数&lt;br&gt;• 节省50%空间</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">压缩格式，节省存储</div></td></tr></tbody></table><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2019860c56ab805fbd72f611d5eca8c4" data-id="2019860c56ab805fbd72f611d5eca8c4"><span><div id="2019860c56ab805fbd72f611d5eca8c4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2019860c56ab805fbd72f611d5eca8c4" title="sm-crypto支持格式"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">sm-crypto支持格式</span></span></h3><table class="notion-simple-table notion-block-2019860c56ab805b95c3ca3bb9ff011f"><tbody><tr class="notion-simple-table-row notion-block-2019860c56ab800ab0f8f9ffce0155fc"><td class="" style="width:120px"><div class="notion-simple-table-cell">算法</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">支持格式</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">长度要求</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">技术细节</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">备注</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab803fa74cdf5a02bce25d"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>SM2</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">HEX、字节数组</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">私钥64位，公钥66/130位（64+2，128+2）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">• 支持公钥压缩&lt;br&gt;• 自动补充04前缀&lt;br&gt;• 兼容多种密文模式</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">公钥可压缩互转</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab80e3ba46f6f95e2e8150"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>SM3</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">HEX、字节数组</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">密钥任意长度</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">• 支持HMAC模式&lt;br&gt;• 输出固定256位&lt;br&gt;• 密钥建议≥256位</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">杂凑算法</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab803286cfe086b51ae5fc"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>SM4</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">HEX、字节数组</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">固定128位</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">• 密钥长度严格128位&lt;br&gt;• 支持CBC/ECB模式&lt;br&gt;• 支持PKCS7填充</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">对称加密算法</div></td></tr></tbody></table><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2019860c56ab80c884a5f59101fdab9a" data-id="2019860c56ab80c884a5f59101fdab9a"><span><div id="2019860c56ab80c884a5f59101fdab9a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2019860c56ab80c884a5f59101fdab9a" title="格式验证规则"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">格式验证规则</span></span></h3><table class="notion-simple-table notion-block-2019860c56ab80ebb5b3fab83822b8a0"><tbody><tr class="notion-simple-table-row notion-block-2019860c56ab803aaee9e1ac9efca3e5"><td class="" style="width:120px"><div class="notion-simple-table-cell">验证项</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">HEX格式</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">字节数组</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">其他格式</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab8088857df58a085544fa"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>字符集</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">只能0-9、a-f</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">0-255整数</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">各自规范</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab8025b56deed321b82e7f"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>长度检查</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">必须偶数长度</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">任意长度</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">固定规则</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab80ed99ebdac9a488d55a"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>大小写</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">不敏感</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">不适用</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">敏感/不敏感</div></td></tr><tr class="notion-simple-table-row notion-block-2019860c56ab8083999ef0779cf8ae27"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>前缀检查</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">SM2公钥需02/03/04</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">对应字节值</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">格式标识</div></td></tr></tbody></table></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rimworld中改变殖民者文化的方法]]></title>
            <link>https://doiiars.com/article/rimworld-ideology-dlc-colonist-conversion-methods-guide</link>
            <guid>https://doiiars.com/article/rimworld-ideology-dlc-colonist-conversion-methods-guide</guid>
            <pubDate>Tue, 01 Apr 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[有三种方法可以改变rimworld游戏中的小人/殖民者的意识形态/文化，这里是详细介绍。 ]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-1c89860c56ab80078ed7c7ff5757499d"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-1c89860c56ab8043a2c6c9e4ddafe54d" data-id="1c89860c56ab8043a2c6c9e4ddafe54d"><span><div id="1c89860c56ab8043a2c6c9e4ddafe54d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c89860c56ab8043a2c6c9e4ddafe54d" title="使用开发者模式直接更改"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">使用开发者模式直接更改</span></span></h3><div class="notion-text notion-block-1c89860c56ab8093ad51faea8d3bd318">最简单直接的方法是使用开发者模式：</div><blockquote class="notion-quote notion-block-1c89860c56ab80a88c09d5e43ab0c6c7"><div>&quot;进入游戏设置菜单，点击&#x27;开发者行动菜单&#x27;，前往&#x27;行动/工具&#x27;选项卡，在&#x27;居民&#x27;部分下搜索或查找&#x27;设置意识形态&#x27;功能。点击&#x27;设置意识形态&#x27;，然后点击所需意识形态，最后点击你想要改变的殖民者&quot; [1]</div></blockquote><div class="notion-text notion-block-1c89860c56ab806f907ff1a46eba3711">具体步骤：</div><ol start="1" class="notion-list notion-list-numbered notion-block-1c89860c56ab8055877ad3a8792da494" style="list-style-type:decimal"><li>进入游戏选项菜单启用开发者模式</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-1c89860c56ab8064b6f8cf93ba12bfa0" style="list-style-type:decimal"><li>找到&quot;Set Ideo&quot;选项(设置意识形态)</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-1c89860c56ab8040a5f2f1b1e0bd18db" style="list-style-type:decimal"><li>先选择要应用的意识形态，再点击目标殖民者</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-1c89860c56ab806f898ff23cd8de2cb8" style="list-style-type:decimal"><li>右键点击取消操作</li></ol><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-1c89860c56ab80c18b80f5a002502043" data-id="1c89860c56ab80c18b80f5a002502043"><span><div id="1c89860c56ab80c18b80f5a002502043" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c89860c56ab80c18b80f5a002502043" title="编辑现有意识形态"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">编辑现有意识形态</span></span></h3><div class="notion-text notion-block-1c89860c56ab804f8a87e232d78349dd">如果你拥有Ideology DLC，可以编辑意识形态本身：</div><blockquote class="notion-quote notion-block-1c89860c56ab8091a681dcd2774e45bf"><div>&quot;你可以通过以下步骤编辑意识形态：进入设置（屏幕底部最右边的选项卡），点击&#x27;开发模式&#x27;将红色X变成绿色对勾，点击意识形态选项卡（靠近最右边的选项卡，看起来像灯泡图标），点击右上角的&#x27;开发编辑&#x27;，按照你的喜好编辑意识形态&quot; [2] [3]</div></blockquote><div class="notion-text notion-block-1c89860c56ab80dd8355f707e4dbd380">通过这种方法，你可以完全自定义意识形态内容，包括模因、角色、仪式等。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-1c89860c56ab803f8fabdc70932c256c" data-id="1c89860c56ab803f8fabdc70932c256c"><span><div id="1c89860c56ab803f8fabdc70932c256c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c89860c56ab803f8fabdc70932c256c" title="通过监禁来转换殖民者"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">通过监禁来转换殖民者</span></span></h3><div class="notion-text notion-block-1c89860c56ab80aba3d5ecfbd28fab3e">不使用开发者模式的游戏内方法：</div><blockquote class="notion-quote notion-block-1c89860c56ab80a18a33cb8502e5a95a"><div>&quot;如果你想不使用开发模式，还可以通过以下方法：逮捕已招募的殖民者，打开他们的囚犯选项并选择&#x27;转换&#x27;选项，一旦囚犯转换为你的意识形态，释放他们即可，不需要重新招募&quot; [4]</div></blockquote><div class="notion-text notion-block-1c89860c56ab80e989e2e3785612bc8f">这种方法是游戏内自带的机制，不需要使用开发者模式。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1c89860c56ab8093aca0c0597ac9076f"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1597456366954-6736fa88cdad%3Fixlib%3Drb-4.0.3%26q%3D50%26fm%3Dwebp%26crop%3Dentropy%26cs%3Dsrgb%26spaceId%3D13a69e84-de26-4e1c-b934-c9bf822b4ebc%26width%3D1080%26fmt%3Dwebp?table=block&amp;id=1c89860c-56ab-8093-aca0-c0597ac9076f&amp;t=1c89860c-56ab-8093-aca0-c0597ac9076f" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-1c89860c56ab80f38cbde53bdb017904" data-id="1c89860c56ab80f38cbde53bdb017904"><span><div id="1c89860c56ab80f38cbde53bdb017904" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c89860c56ab80f38cbde53bdb017904" title="关于文化系统的附加信息"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">关于文化系统的附加信息</span></span></h3><blockquote class="notion-quote notion-block-1c89860c56ab800bad38d9518792f3cb"><div>&quot;文化DLC引入了信仰系统，允许殖民地引入各种新的限制和能力来改变游戏玩法。这个系统决定了殖民地的领袖、传道者和各类专家等社会职位，也定义了从温馨的聚会到残酷的献祭仪式等各种节日&quot; [5]</div></blockquote><div class="notion-text notion-block-1c89860c56ab8055a25fe0b2d5934fff">改变殖民者的文化将显著影响他们的行为、偏好和互动方式。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-1c89860c56ab80ff9a47ea36f7156af4" data-id="1c89860c56ab80ff9a47ea36f7156af4"><span><div id="1c89860c56ab80ff9a47ea36f7156af4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c89860c56ab80ff9a47ea36f7156af4" title="参考链接"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">参考链接</span></span></h3><ol start="1" class="notion-list notion-list-numbered notion-block-1c89860c56ab803c8802dad21887f8a3" style="list-style-type:decimal"><li><a class="notion-link" href="https://rimworldwiki.com/wiki/Development_mode" target="_blank" rel="noopener noreferrer">Development mode - RimWorld Wiki</a></li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-1c89860c56ab8034af9ac25efb2ebd3a" style="list-style-type:decimal"><li><a class="notion-link" href="https://steamcommunity.com/app/294100/discussions/0/3058491773339900039/" target="_blank" rel="noopener noreferrer">Using Dev mode to change pawn ideology :: RimWorld General Discussions</a></li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-1c89860c56ab809ca07cdda50103e687" style="list-style-type:decimal"><li><a class="notion-link" href="https://steamcommunity.com/app/294100/discussions/0/3058491773328265129/" target="_blank" rel="noopener noreferrer">You can edit Ideologies mid game using Dev Mode :: RimWorld General Discussions</a></li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-1c89860c56ab804eb33efb109e8e1e2e" style="list-style-type:decimal"><li><a class="notion-link" href="https://gamerempire.net/rimworld-how-to-change-ideology-and-convert-colonists/" target="_blank" rel="noopener noreferrer">RimWorld - How to Change Ideology and Convert Colonists - Gamer Empire</a></li></ol><ol start="5" class="notion-list notion-list-numbered notion-block-1c89860c56ab805ba09ce80ece737dbb" style="list-style-type:decimal"><li><a class="notion-link" href="https://rimworld.huijiwiki.com/wiki/%E6%96%87%E5%8C%96(DLC)" target="_blank" rel="noopener noreferrer">文化(DLC) - Rimworld中文维基</a></li></ol></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[最全免费 ASR 服务合集！（阿里云系列模型）]]></title>
            <link>https://doiiars.com/article/aliyun-free-asr-service</link>
            <guid>https://doiiars.com/article/aliyun-free-asr-service</guid>
            <pubDate>Fri, 28 Mar 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[最近想白嫖阿里云服务，我整理了阿里云提供的免费语音识别（ASR）服务及其额度，方便大家快速了解和使用。文末附带对比表格。]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-1c49860c56ab801ab3c2f15ffb0d4fd7"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-1c49860c56ab808b9f1ed26485096e2f">最近想白嫖阿里云服务，我整理了阿里云提供的免费语音识别（ASR）服务及其额度，方便大家快速了解和使用。文末附带对比表格。</div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-1c49860c56ab8070ab7fe30979e0066e" data-id="1c49860c56ab8070ab7fe30979e0066e"><span><div id="1c49860c56ab8070ab7fe30979e0066e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c49860c56ab8070ab7fe30979e0066e" title="阿里云免费 ASR 服务概览"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">阿里云免费 ASR 服务概览</span></span></h3><div class="notion-text notion-block-1c49860c56ab801e8513e04bbcab7622">阿里云提供了多种语音识别模型，部分模型提供免费额度，方便用户体验和测试。以下是详细信息：</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-1c49860c56ab80edb194fcf667546278" data-id="1c49860c56ab80edb194fcf667546278"><span><div id="1c49860c56ab80edb194fcf667546278" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c49860c56ab80edb194fcf667546278" title="1. 通义千问 ASR 模型"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1. 通义千问 ASR 模型</span></span></h4><ul class="notion-list notion-list-disc notion-block-1c49860c56ab806b98dad0c2cbf84fd8"><li><b>模型特点</b>：基于 Qwen-Audio 训练，专用于中英文语音识别。目前处于 Beta 版本。</li></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab808c86bbdf7c49af206a"><li><b>计费方式</b>：按 Token 数计费。每秒音频对应 25 个 Token（不足 1 秒按 25 个 Token 计算）。</li></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab80f584c9eeb92b7b4258"><li><b>模型列表</b>：</li><ul class="notion-list notion-list-disc notion-block-1c49860c56ab80f584c9eeb92b7b4258"><li><code class="notion-inline-code">qwen-audio-asr</code>（稳定版，等同 <code class="notion-inline-code">qwen-audio-asr-2024-12-04</code>）</li><li><code class="notion-inline-code">qwen-audio-asr-latest</code>（最新版）</li><li><code class="notion-inline-code">qwen-audio-asr-2024-12-04</code>（快照版）</li></ul></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab80f8aab4d672ff9776ae"><li><b>支持</b>：中文、英文，16kHz 采样率音频。</li></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab808ebb0be73aa59770e6"><li><b>免费额度</b>：10 万 Token，有效期为百炼开通后 180 天。</li></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab80f2a763e36d2f872ebf"><li><b>单价：</b>目前仅供免费体验。</li></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab80af8252f53a83d77f06"><li><b>注意</b>：免费额度用完后不可调用，请关注后续动态。不支持多轮对话和自定义 Prompt。</li></ul><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1c49860c56ab805c8796e58cf59539ae"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1557180295-76eee20ae8aa%3Fixlib%3Drb-4.0.3%26q%3D50%26fm%3Dwebp%26crop%3Dentropy%26cs%3Dsrgb%26spaceId%3D13a69e84-de26-4e1c-b934-c9bf822b4ebc%26width%3D1080%26fmt%3Dwebp?table=block&amp;id=1c49860c-56ab-805c-8796-e58cf59539ae&amp;t=1c49860c-56ab-805c-8796-e58cf59539ae" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-1c49860c56ab801aada7d2d81929ba8a" data-id="1c49860c56ab801aada7d2d81929ba8a"><span><div id="1c49860c56ab801aada7d2d81929ba8a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c49860c56ab801aada7d2d81929ba8a" title="2. Paraformer 模型"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2. Paraformer 模型</span></span></h4><ul class="notion-list notion-list-disc notion-block-1c49860c56ab804f9058e9a9c31c20c6"><li><b>模型特点</b>：基于通义实验室新一代非自回归端到端模型，提高语音识别的精度和准确率。</li></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab808fa8e5f90a0f66126a"><li><b>模型列表</b>：</li><ul class="notion-list notion-list-disc notion-block-1c49860c56ab808fa8e5f90a0f66126a"><li><code class="notion-inline-code">paraformer-v2</code>：支持多种语言，适用视频直播场景。</li><li><code class="notion-inline-code">paraformer-8k-v2</code>：中文普通话，8kHz 采样率，适用于电话语音。</li><li><code class="notion-inline-code">paraformer-v1</code>：支持中文普通话、英语，适用音频或视频。</li><li><code class="notion-inline-code">paraformer-8k-v1</code>：中文普通话，8kHz 采样率，适用于电话语音。</li><li><code class="notion-inline-code">paraformer-mtl-v1</code>：支持多种语言，16kHz 及以上采样率，适用音频或视频。</li></ul></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab80a68fb8f330fcbc60ce"><li><b>支持</b>：不同版本支持中文普通话、多种中文方言、英语、日语、韩语、德语、法语、俄语等。</li></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab80c9b8affa68391f73f2"><li><b>免费额度</b>：<code class="notion-inline-code">paraformer-v2</code> 提供每月 36,000 秒（10 小时）的免费额度，每月 1 日 0 点自动发放，有效期 1 个月。</li></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab805b8198d93a3f9d6829"><li><b>单价</b>：<code class="notion-inline-code">paraformer-v2</code> 定价为 <b>0.00008 元/秒</b>，或<b>0.00480元/分钟</b>，或<b>0.288元/小时</b></li></ul><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1c49860c56ab804d86c4c596e78fa6fa"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1523966211575-eb4a01e7dd51%3Fixlib%3Drb-4.0.3%26q%3D50%26fm%3Dwebp%26crop%3Dentropy%26cs%3Dsrgb%26spaceId%3D13a69e84-de26-4e1c-b934-c9bf822b4ebc%26width%3D1080%26fmt%3Dwebp?table=block&amp;id=1c49860c-56ab-804d-86c4-c596e78fa6fa&amp;t=1c49860c-56ab-804d-86c4-c596e78fa6fa" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-1c49860c56ab80569775d32d446489b0" data-id="1c49860c56ab80569775d32d446489b0"><span><div id="1c49860c56ab80569775d32d446489b0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c49860c56ab80569775d32d446489b0" title="3. SenseVoice 模型"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3. SenseVoice 模型</span></span></h4><ul class="notion-list notion-list-disc notion-block-1c49860c56ab8059b0a6c8da50383811"><li><b>模型特点</b>：专注于高精度多语言语音识别、情感辨识和音频事件检测，支持超过 50 种语言。</li></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab8063a8cbfdf481e69807"><li><b>模型列表</b>：<code class="notion-inline-code">sensevoice-v1</code></li></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab801f945fd00918a4a139"><li><b>支持</b>：超过 50 种语言（包括中、英、日、韩、粤等）。</li></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab803da5e4d1148fc9f792"><li><b>免费额度</b>：每月 36,000 秒（10 小时），每月 1 日 0 点自动发放，有效期 1 个月。</li></ul><ul class="notion-list notion-list-disc notion-block-1c49860c56ab809aacbec4201898dbaf"><li><b>单价</b>：<b>0.0007 元/秒</b>，或<b>0.042元/分钟</b>，或<b>2.52元/小时</b></li></ul><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1c49860c56ab805f93edcc303ad32833"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1485579149621-3123dd979885%3Fixlib%3Drb-4.0.3%26q%3D50%26fm%3Dwebp%26crop%3Dentropy%26cs%3Dsrgb%26spaceId%3D13a69e84-de26-4e1c-b934-c9bf822b4ebc%26width%3D1080%26fmt%3Dwebp?table=block&amp;id=1c49860c-56ab-805f-93ed-cc303ad32833&amp;t=1c49860c-56ab-805f-93ed-cc303ad32833" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-1c49860c56ab8086b9f9fa74b597af89">为了更直观地对比这些 ASR 服务的特性和免费额度，整理了以下表格：</div><table class="notion-simple-table notion-block-1c49860c56ab80e0a576c5ca4c8489e1"><tbody><tr class="notion-simple-table-row notion-block-1c49860c56ab809db8eec4fcebd7e8b7"><td class="" style="width:120px"><div class="notion-simple-table-cell">模型名称</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">主要特点</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">支持语言</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">免费额度</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">计费方式</div></td></tr><tr class="notion-simple-table-row notion-block-1c49860c56ab8010824afec8a8177962"><td class="" style="width:120px"><div class="notion-simple-table-cell">通义千问 ASR</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">基于 Qwen-Audio，中英文识别，Beta 版本</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">中文、英文</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">10 万 Token（百炼开通后 180 天内有效）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">按 Token 数计费</div></td></tr><tr class="notion-simple-table-row notion-block-1c49860c56ab804b8854f75f52ea350b"><td class="" style="width:120px"><div class="notion-simple-table-cell">Paraformer-v2</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">通义实验室新一代模型，高精度识别，适用视频直播</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">中文普通话、中文方言（粤语、吴语、闽南语、东北话、甘肃话、贵州话、河南话、湖北话、湖南话、宁夏话、山西话、陕西话、山东话、四川话、天津话）、英语、日语、韩语、德语、法语、俄语等</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">36,000 秒/月（每月 1 日发放，有效期 1 个月）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">按秒计费</div></td></tr><tr class="notion-simple-table-row notion-block-1c49860c56ab8074beabd4b536c04d28"><td class="" style="width:120px"><div class="notion-simple-table-cell">SenseVoice-v1</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">高精度多语言识别，支持情感辨识和音频事件检测</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">超过 50 种语言（中、英、日、韩、粤等）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">36,000 秒/月（每月 1 日发放，有效期 1 个月）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">按秒计费</div></td></tr></tbody></table><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-1c49860c56ab805e8641d527063e67d2" data-id="1c49860c56ab805e8641d527063e67d2"><span><div id="1c49860c56ab805e8641d527063e67d2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c49860c56ab805e8641d527063e67d2" title="总的来说"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">总的来说</span></span></h3><div class="notion-text notion-block-1c49860c56ab806a967afeea5d25f01b">阿里云提供了多种 ASR 模型，其中 <b>Paraformer-v2</b> 和 <b>SenseVoice-v1</b> 均提供每月 10 小时的免费额度，而 <b>通义千问 ASR</b> 提供 10 万 Token 的尝鲜额度。用户可以根据自身需求选择合适的模型进行体验和使用。</div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>