421 lines
26 KiB
HTML
421 lines
26 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh_CN">
|
||
<head>
|
||
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
||
|
||
<title>安装 Python 模块 — Python 3.8.20 文档</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
||
<link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
|
||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||
|
||
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||
<script src="../_static/jquery.js"></script>
|
||
<script src="../_static/underscore.js"></script>
|
||
<script src="../_static/doctools.js"></script>
|
||
<script src="../_static/language_data.js"></script>
|
||
<script src="../_static/translations.js"></script>
|
||
|
||
<script src="../_static/sidebar.js"></script>
|
||
|
||
<link rel="search" type="application/opensearchdescription+xml"
|
||
title="在 Python 3.8.20 文档 中搜索"
|
||
href="../_static/opensearch.xml"/>
|
||
<link rel="author" title="关于这些文档" href="../about.html" />
|
||
<link rel="index" title="索引" href="../genindex.html" />
|
||
<link rel="search" title="搜索" href="../search.html" />
|
||
<link rel="copyright" title="版权所有" href="../copyright.html" />
|
||
<link rel="next" title="Python 指南" href="../howto/index.html" />
|
||
<link rel="prev" title="分发 Python 模块" href="../distributing/index.html" />
|
||
<link rel="canonical" href="https://docs.python.org/3/installing/index.html" />
|
||
|
||
|
||
|
||
|
||
|
||
<style>
|
||
@media only screen {
|
||
table.full-width-table {
|
||
width: 100%;
|
||
}
|
||
}
|
||
</style>
|
||
<link rel="shortcut icon" type="image/png" href="../_static/py.svg" />
|
||
<script type="text/javascript" src="../_static/copybutton.js"></script>
|
||
<script type="text/javascript" src="../_static/menu.js"></script>
|
||
|
||
</head>
|
||
<body>
|
||
<div class="mobile-nav">
|
||
<input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"
|
||
aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" />
|
||
<label for="menuToggler" class="toggler__label">
|
||
<span></span>
|
||
</label>
|
||
<nav class="nav-content" role="navigation">
|
||
<a href="https://www.python.org/" class="nav-logo">
|
||
<img src="../_static/py.svg" alt="Logo"/>
|
||
</a>
|
||
<div class="version_switcher_placeholder"></div>
|
||
<form role="search" class="search" action="../search.html" method="get">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">
|
||
<path fill-rule="nonzero"
|
||
d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" fill="#444"></path>
|
||
</svg>
|
||
<input type="text" name="q" aria-label="快速搜索"/>
|
||
<input type="submit" value="转向"/>
|
||
</form>
|
||
</nav>
|
||
<div class="menu-wrapper">
|
||
<nav class="menu" role="navigation" aria-label="main navigation">
|
||
<div class="language_switcher_placeholder"></div>
|
||
<h3><a href="../contents.html">目录</a></h3>
|
||
<ul>
|
||
<li><a class="reference internal" href="#">安装 Python 模块</a><ul>
|
||
<li><a class="reference internal" href="#key-terms">关键术语</a></li>
|
||
<li><a class="reference internal" href="#basic-usage">基本使用</a></li>
|
||
<li><a class="reference internal" href="#how-do-i">我应如何 ...?</a><ul>
|
||
<li><a class="reference internal" href="#install-pip-in-versions-of-python-prior-to-python-3-4">... 在 Python 3.4 之前的 Python 版本中安装 <code class="docutils literal notranslate"><span class="pre">pip</span></code> ?</a></li>
|
||
<li><a class="reference internal" href="#install-packages-just-for-the-current-user">... 只为当前用户安装软件包?</a></li>
|
||
<li><a class="reference internal" href="#install-scientific-python-packages">... 安装科学计算类 Python 软件包?</a></li>
|
||
<li><a class="reference internal" href="#work-with-multiple-versions-of-python-installed-in-parallel">... 使用并行安装的多个 Python 版本?</a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#common-installation-issues">常见的安装问题</a><ul>
|
||
<li><a class="reference internal" href="#installing-into-the-system-python-on-linux">在 Linux 的系统 Python 版本上安装</a></li>
|
||
<li><a class="reference internal" href="#pip-not-installed">未安装 pip</a></li>
|
||
<li><a class="reference internal" href="#installing-binary-extensions">安装二进制编译扩展</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<h4>上一个主题</h4>
|
||
<p class="topless"><a href="../distributing/index.html"
|
||
title="上一章">分发 Python 模块</a></p>
|
||
<h4>下一个主题</h4>
|
||
<p class="topless"><a href="../howto/index.html"
|
||
title="下一章">Python 指南</a></p>
|
||
<div role="note" aria-label="source link">
|
||
<h3>本页</h3>
|
||
<ul class="this-page-menu">
|
||
<li><a href="../bugs.html">报告 Bug</a></li>
|
||
<li>
|
||
<a href="https://github.com/python/cpython/blob/3.8/Doc/installing/index.rst"
|
||
rel="nofollow">显示源代码
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</nav>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outdated-warning" style="padding: .5em; text-align: center; background-color: #FFBABA; color: #6A0E0E;">
|
||
这个文档所针对的是一个已不再受支持的 Python 旧版本。
|
||
你应当升级版本,并阅读
|
||
<a href="/3/installing/index.html"> Python 当前稳定版本的文档</a>.
|
||
</div>
|
||
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>导航</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="../genindex.html" title="总目录"
|
||
accesskey="I">索引</a></li>
|
||
<li class="right" >
|
||
<a href="../py-modindex.html" title="Python 模块索引"
|
||
>模块</a> |</li>
|
||
<li class="right" >
|
||
<a href="../howto/index.html" title="Python 指南"
|
||
accesskey="N">下一页</a> |</li>
|
||
<li class="right" >
|
||
<a href="../distributing/index.html" title="分发 Python 模块"
|
||
accesskey="P">上一页</a> |</li>
|
||
|
||
<li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
|
||
<li><a href="https://www.python.org/">Python</a> »</li>
|
||
<li class="switchers">
|
||
<div class="language_switcher_placeholder"></div>
|
||
<div class="version_switcher_placeholder"></div>
|
||
</li>
|
||
<li>
|
||
|
||
</li>
|
||
<li id="cpython-language-and-version">
|
||
<a href="../index.html">3.8.20 Documentation</a> »
|
||
</li>
|
||
|
||
<li class="right">
|
||
|
||
|
||
<div class="inline-search" role="search">
|
||
<form class="inline-search" action="../search.html" method="get">
|
||
<input placeholder="快速搜索" aria-label="快速搜索" type="text" name="q" />
|
||
<input type="submit" value="转向" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
|
|
||
</li>
|
||
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<section id="installing-python-modules">
|
||
<span id="installing-index"></span><h1>安装 Python 模块<a class="headerlink" href="#installing-python-modules" title="永久链接至标题">¶</a></h1>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">电子邮箱</dt>
|
||
<dd class="field-odd"><p><a class="reference external" href="mailto:distutils-sig%40python.org">distutils-sig<span>@</span>python<span>.</span>org</a></p>
|
||
</dd>
|
||
</dl>
|
||
<p>作为一个流行的开源开发项目,Python拥有一个活跃的贡献者和用户支持社区,这些社区也可以让他们的软件可供其他Python开发人员在开源许可条款下使用。</p>
|
||
<p>这允许Python用户有效地共享和协作,从其他人已经创建的解决方案中受益于常见(有时甚至是罕见的)问题,以及可以提供他们自己的解决方案。</p>
|
||
<p>本指南涵盖了分发部分的流程。有关安装其他Python项目的指南,请参阅 <a class="reference internal" href="../distributing/index.html#distributing-index"><span class="std std-ref">安装指南</span></a>。</p>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">注解</p>
|
||
<p>对于企业和其他机构用户,请注意许多组织都有自己的政策来使用和贡献开源软件。在使用Python提供的分发和安装工具时,请考虑这些政策。</p>
|
||
</div>
|
||
<section id="key-terms">
|
||
<h2>关键术语<a class="headerlink" href="#key-terms" title="永久链接至标题">¶</a></h2>
|
||
<ul class="simple">
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">pip</span></code> 是首选的安装程序。从Python 3.4开始,它默认包含在Python二进制安装程序中。</p></li>
|
||
<li><p><em>virtual environment</em> 是一种半隔离的 Python 环境,允许为特定的应用安装各自的包,而不是安装到整个系统。</p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">venv</span></code> 是创建虚拟环境的标准工具,从 Python 3.3 开始成为 Python 的组成部分。 从 Python 3.4 开始,它会默认安装 <code class="docutils literal notranslate"><span class="pre">pip</span></code> 到所创建的全部虚拟环境。</p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">virtualenv</span></code> 是 <code class="docutils literal notranslate"><span class="pre">venv</span></code> 的第三方替代(及其前身)。 它允许在 Python 3.4 之前的版本中使用虚拟环境,那些版本或是完全不提供 <code class="docutils literal notranslate"><span class="pre">venv</span></code>,或是不会自动安装 <code class="docutils literal notranslate"><span class="pre">pip</span></code> 到所创建的虚拟环境。</p></li>
|
||
<li><p><a class="reference external" href="https://pypi.org">Python Packaging Index</a> 是一个由 Python 用户向其他用户发布开源许可软件包的公共仓库。</p></li>
|
||
<li><p><a class="reference external" href="https://www.pypa.io/">Python Packaging Authority</a> 是负责标准打包工具以及相关元数据和文件格式标准维护与改进的开发人员和文档作者团队。 他们基于 <a class="reference external" href="https://github.com/pypa">GitHub</a> 和 <a class="reference external" href="https://bitbucket.org/pypa/">Bitbucket</a> 这两个平台维护着各种工具、文档和问题追踪系统。</p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">distutils</span></code> 是最初的构建和分发系统,于 1998 年首次加入 Python 标准库。 虽然直接使用 <code class="docutils literal notranslate"><span class="pre">distutils</span></code> 的方式已被淘汰,它仍然是当前打包和分发架构的基础,而且它不仅仍然是标准库的一部分,这个名称还以其他方式存在(例如用于协调 Python 打包标准开发流程的邮件列表就以此命名)。</p></li>
|
||
</ul>
|
||
<div class="versionchanged">
|
||
<p><span class="versionmodified changed">在 3.5 版更改: </span>现在推荐使用 <code class="docutils literal notranslate"><span class="pre">venv</span></code> 来创建虚拟环境。</p>
|
||
</div>
|
||
<div class="admonition seealso">
|
||
<p class="admonition-title">参见</p>
|
||
<p><a class="reference external" href="https://packaging.python.org/installing/#creating-virtual-environments">Python 软件包用户指南:创建和使用虚拟环境</a></p>
|
||
</div>
|
||
</section>
|
||
<section id="basic-usage">
|
||
<h2>基本使用<a class="headerlink" href="#basic-usage" title="永久链接至标题">¶</a></h2>
|
||
<p>标准打包工具完全是针对命令行使用方式来设计的。</p>
|
||
<p>以下命令将从 Python Packaging Index 安装一个模块的最新版本及其依赖项:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python -m pip install SomePackage
|
||
</pre></div>
|
||
</div>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">注解</p>
|
||
<p>对于 POSIX 用户(包括 Mac OS X 和 Linux 用户)本指南中的示例假定使用了 <a class="reference internal" href="../glossary.html#term-virtual-environment"><span class="xref std std-term">virtual environment</span></a>。</p>
|
||
<p>对于 Windows 用户,本指南中的示例假定在安装 Python 时选择了修改系统 PATH 环境变量。</p>
|
||
</div>
|
||
<p>在命令行中指定一个准确或最小版本也是可以的。 当使用比较运算符例如 <code class="docutils literal notranslate"><span class="pre">></span></code>, <code class="docutils literal notranslate"><span class="pre"><</span></code> 或其他某些可以被终端所解析的特殊字符时,包名称与版本号应当用双引号括起来:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python -m pip install SomePackage==1.0.4 # specific version
|
||
python -m pip install "SomePackage>=1.0.4" # minimum version
|
||
</pre></div>
|
||
</div>
|
||
<p>通常,如果一个匹配的模块已安装,尝试再次安装将不会有任何效果。 要升级现有模块必须显式地发出请求:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python -m pip install --upgrade SomePackage
|
||
</pre></div>
|
||
</div>
|
||
<p>更多有关 <code class="docutils literal notranslate"><span class="pre">pip</span></code> 及其功能的信息和资源可以在 <a class="reference external" href="https://packaging.python.org">Python 软件包用户指南</a> 中找到。</p>
|
||
<p>虚拟环境的创建可使用 <a class="reference internal" href="../library/venv.html#module-venv" title="venv: Creation of virtual environments."><code class="xref py py-mod docutils literal notranslate"><span class="pre">venv</span></code></a> 模块来完成。 向已激活虚拟环境安装软件包可使用上文所介绍的命令。</p>
|
||
<div class="admonition seealso">
|
||
<p class="admonition-title">参见</p>
|
||
<p><a class="reference external" href="https://packaging.python.org/installing/">Python 软件包用户指南:安装 Python 分发包</a></p>
|
||
</div>
|
||
</section>
|
||
<section id="how-do-i">
|
||
<h2>我应如何 ...?<a class="headerlink" href="#how-do-i" title="永久链接至标题">¶</a></h2>
|
||
<p>这是一些常见任务的快速解答或相关链接。</p>
|
||
<section id="install-pip-in-versions-of-python-prior-to-python-3-4">
|
||
<h3>... 在 Python 3.4 之前的 Python 版本中安装 <code class="docutils literal notranslate"><span class="pre">pip</span></code> ?<a class="headerlink" href="#install-pip-in-versions-of-python-prior-to-python-3-4" title="永久链接至标题">¶</a></h3>
|
||
<p>Python 捆绑 <code class="docutils literal notranslate"><span class="pre">pip</span></code> 是从 Python 3.4 才开始的。 对于更早的版本,<code class="docutils literal notranslate"><span class="pre">pip</span></code> 需要“引导安装”,具体说明参见 Python 软件包用户指南。</p>
|
||
<div class="admonition seealso">
|
||
<p class="admonition-title">参见</p>
|
||
<p><a class="reference external" href="https://packaging.python.org/installing/#requirements-for-installing-packages">Python 软件包用户指南:安装软件包的前提要求</a></p>
|
||
</div>
|
||
</section>
|
||
<section id="install-packages-just-for-the-current-user">
|
||
<h3>... 只为当前用户安装软件包?<a class="headerlink" href="#install-packages-just-for-the-current-user" title="永久链接至标题">¶</a></h3>
|
||
<p>将 <code class="docutils literal notranslate"><span class="pre">--user</span></code> 选项传入 <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">pip</span> <span class="pre">install</span></code> 将只为当前用户而非为系统中的所有用户安装软件包。</p>
|
||
</section>
|
||
<section id="install-scientific-python-packages">
|
||
<h3>... 安装科学计算类 Python 软件包?<a class="headerlink" href="#install-scientific-python-packages" title="永久链接至标题">¶</a></h3>
|
||
<p>许多科学计算类 Python 软件包都有复杂的二进制编译文件依赖,直接使用 <code class="docutils literal notranslate"><span class="pre">pip</span></code> 安装目前并不太容易。 在当前情况下,通过 <a class="reference external" href="https://packaging.python.org/science/">其他方式</a> 而非尝试用 <code class="docutils literal notranslate"><span class="pre">pip</span></code> 安装这些软件包对用户来说通常会更容易。</p>
|
||
<div class="admonition seealso">
|
||
<p class="admonition-title">参见</p>
|
||
<p><a class="reference external" href="https://packaging.python.org/science/">Python 软件包用户指南:安装科学计算类软件包</a></p>
|
||
</div>
|
||
</section>
|
||
<section id="work-with-multiple-versions-of-python-installed-in-parallel">
|
||
<h3>... 使用并行安装的多个 Python 版本?<a class="headerlink" href="#work-with-multiple-versions-of-python-installed-in-parallel" title="永久链接至标题">¶</a></h3>
|
||
<p>在 Linux, Mac OS X 以及其他 POSIX 系统中,使用带版本号的 Python 命令配合 <code class="docutils literal notranslate"><span class="pre">-m</span></code> 开关选项来运行特定版本的 <code class="docutils literal notranslate"><span class="pre">pip</span></code>:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python2 -m pip install SomePackage # default Python 2
|
||
python2.7 -m pip install SomePackage # specifically Python 2.7
|
||
python3 -m pip install SomePackage # default Python 3
|
||
python3.4 -m pip install SomePackage # specifically Python 3.4
|
||
</pre></div>
|
||
</div>
|
||
<p>也可以使用带特定版本号的 <code class="docutils literal notranslate"><span class="pre">pip</span></code> 命令。</p>
|
||
<p>在 Windows 中,使用 <code class="docutils literal notranslate"><span class="pre">py</span></code> Python 启动器命令配合 <code class="docutils literal notranslate"><span class="pre">-m</span></code> 开关选项:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>py -2 -m pip install SomePackage # default Python 2
|
||
py -2.7 -m pip install SomePackage # specifically Python 2.7
|
||
py -3 -m pip install SomePackage # default Python 3
|
||
py -3.4 -m pip install SomePackage # specifically Python 3.4
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
</section>
|
||
<section id="common-installation-issues">
|
||
<h2>常见的安装问题<a class="headerlink" href="#common-installation-issues" title="永久链接至标题">¶</a></h2>
|
||
<section id="installing-into-the-system-python-on-linux">
|
||
<h3>在 Linux 的系统 Python 版本上安装<a class="headerlink" href="#installing-into-the-system-python-on-linux" title="永久链接至标题">¶</a></h3>
|
||
<p>Linux 系统通常会将某个 Python 版本作为发行版的一部分包含在内。 将软件包安装到这个 Python 版本上需要系统 root 权限,并可能会干扰到系统包管理器和其他系统组件的运作,如果这些组件在使用 <code class="docutils literal notranslate"><span class="pre">pip</span></code> 时被意外升级的话。</p>
|
||
<p>在这样的系统上,通过 <code class="docutils literal notranslate"><span class="pre">pip</span></code> 安装软件包通常最好是使用虚拟环境或分用户安装。</p>
|
||
</section>
|
||
<section id="pip-not-installed">
|
||
<h3>未安装 pip<a class="headerlink" href="#pip-not-installed" title="永久链接至标题">¶</a></h3>
|
||
<p>默认情况下可能未安装 <code class="docutils literal notranslate"><span class="pre">pip</span></code>,一种可选解决方案是:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>python -m ensurepip --default-pip
|
||
</pre></div>
|
||
</div>
|
||
<p>还有其他资源可用来 <a class="reference external" href="https://packaging.python.org/tutorials/installing-packages/#install-pip-setuptools-and-wheel">安装 pip</a></p>
|
||
</section>
|
||
<section id="installing-binary-extensions">
|
||
<h3>安装二进制编译扩展<a class="headerlink" href="#installing-binary-extensions" title="永久链接至标题">¶</a></h3>
|
||
<p>Python 通常非常依赖基于源代码的发布方式,也就是期望最终用户在安装过程中使用源码来编译生成扩展模块。</p>
|
||
<p>随着对二进制码 <code class="docutils literal notranslate"><span class="pre">wheel</span></code> 格式支持的引入,以及通过 Python Packaging Index 至少发布 Windows 和 Mac OS X 版的 wheel 文件,预计此问题将逐步得到解决,因为用户将能够更频繁地安装预编译扩展,而不再需要自己编译它们。</p>
|
||
<p>某些用来安装 <a class="reference external" href="https://packaging.python.org/science/">科学计算类软件包</a> 的解决方案对于尚未提供预编译 <code class="docutils literal notranslate"><span class="pre">wheel</span></code> 文件的那些扩展模块来说,也有助于用户在无需进行本机编译的情况下获取二进制码扩展模块。</p>
|
||
<div class="admonition seealso">
|
||
<p class="admonition-title">参见</p>
|
||
<p><a class="reference external" href="https://packaging.python.org/extensions/">Python 软件包用户指南:二进制码扩展</a></p>
|
||
</div>
|
||
</section>
|
||
</section>
|
||
</section>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<h3><a href="../contents.html">目录</a></h3>
|
||
<ul>
|
||
<li><a class="reference internal" href="#">安装 Python 模块</a><ul>
|
||
<li><a class="reference internal" href="#key-terms">关键术语</a></li>
|
||
<li><a class="reference internal" href="#basic-usage">基本使用</a></li>
|
||
<li><a class="reference internal" href="#how-do-i">我应如何 ...?</a><ul>
|
||
<li><a class="reference internal" href="#install-pip-in-versions-of-python-prior-to-python-3-4">... 在 Python 3.4 之前的 Python 版本中安装 <code class="docutils literal notranslate"><span class="pre">pip</span></code> ?</a></li>
|
||
<li><a class="reference internal" href="#install-packages-just-for-the-current-user">... 只为当前用户安装软件包?</a></li>
|
||
<li><a class="reference internal" href="#install-scientific-python-packages">... 安装科学计算类 Python 软件包?</a></li>
|
||
<li><a class="reference internal" href="#work-with-multiple-versions-of-python-installed-in-parallel">... 使用并行安装的多个 Python 版本?</a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#common-installation-issues">常见的安装问题</a><ul>
|
||
<li><a class="reference internal" href="#installing-into-the-system-python-on-linux">在 Linux 的系统 Python 版本上安装</a></li>
|
||
<li><a class="reference internal" href="#pip-not-installed">未安装 pip</a></li>
|
||
<li><a class="reference internal" href="#installing-binary-extensions">安装二进制编译扩展</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<h4>上一个主题</h4>
|
||
<p class="topless"><a href="../distributing/index.html"
|
||
title="上一章">分发 Python 模块</a></p>
|
||
<h4>下一个主题</h4>
|
||
<p class="topless"><a href="../howto/index.html"
|
||
title="下一章">Python 指南</a></p>
|
||
<div role="note" aria-label="source link">
|
||
<h3>本页</h3>
|
||
<ul class="this-page-menu">
|
||
<li><a href="../bugs.html">报告 Bug</a></li>
|
||
<li>
|
||
<a href="https://github.com/python/cpython/blob/3.8/Doc/installing/index.rst"
|
||
rel="nofollow">显示源代码
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></div>
|
||
</div>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>导航</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="../genindex.html" title="总目录"
|
||
>索引</a></li>
|
||
<li class="right" >
|
||
<a href="../py-modindex.html" title="Python 模块索引"
|
||
>模块</a> |</li>
|
||
<li class="right" >
|
||
<a href="../howto/index.html" title="Python 指南"
|
||
>下一页</a> |</li>
|
||
<li class="right" >
|
||
<a href="../distributing/index.html" title="分发 Python 模块"
|
||
>上一页</a> |</li>
|
||
|
||
<li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
|
||
<li><a href="https://www.python.org/">Python</a> »</li>
|
||
<li class="switchers">
|
||
<div class="language_switcher_placeholder"></div>
|
||
<div class="version_switcher_placeholder"></div>
|
||
</li>
|
||
<li>
|
||
|
||
</li>
|
||
<li id="cpython-language-and-version">
|
||
<a href="../index.html">3.8.20 Documentation</a> »
|
||
</li>
|
||
|
||
<li class="right">
|
||
|
||
|
||
<div class="inline-search" role="search">
|
||
<form class="inline-search" action="../search.html" method="get">
|
||
<input placeholder="快速搜索" aria-label="快速搜索" type="text" name="q" />
|
||
<input type="submit" value="转向" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
|
|
||
</li>
|
||
|
||
</ul>
|
||
</div>
|
||
<div class="footer">
|
||
© <a href="../copyright.html">版权所有</a> 2001-2024, Python Software Foundation.
|
||
<br />
|
||
This page is licensed under the Python Software Foundation License Version 2.
|
||
<br />
|
||
Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
|
||
<br />
|
||
|
||
<br />
|
||
|
||
The Python Software Foundation is a non-profit corporation.
|
||
<a href="https://www.python.org/psf/donations/">Please donate.</a>
|
||
<br />
|
||
<br />
|
||
|
||
最后更新于 12月 09, 2024.
|
||
<a href="https://docs.python.org/3/bugs.html">Found a bug</a>?
|
||
<br />
|
||
|
||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 2.4.4.
|
||
</div>
|
||
|
||
</body>
|
||
</html> |