unix.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
  6. <meta property="og:title" content="2. Using Python on Unix platforms" />
  7. <meta property="og:type" content="website" />
  8. <meta property="og:url" content="https://docs.python.org/3/using/unix.html" />
  9. <meta property="og:site_name" content="Python documentation" />
  10. <meta property="og:description" content="Getting and installing the latest version of Python: On Linux: Python comes preinstalled on most Linux distributions, and is available as a package on all others. However there are certain features..." />
  11. <meta property="og:image" content="https://docs.python.org/3/_static/og-image.png" />
  12. <meta property="og:image:alt" content="Python documentation" />
  13. <meta name="description" content="Getting and installing the latest version of Python: On Linux: Python comes preinstalled on most Linux distributions, and is available as a package on all others. However there are certain features..." />
  14. <meta property="og:image:width" content="200" />
  15. <meta property="og:image:height" content="200" />
  16. <meta name="theme-color" content="#3776ab" />
  17. <title>2. Using Python on Unix platforms &#8212; Python 3.12.0 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
  18. <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
  19. <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?digest=b37c26da2f7529d09fe70b41c4b2133fe4931a90" />
  20. <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css" />
  21. <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
  22. <script src="../_static/jquery.js"></script>
  23. <script src="../_static/underscore.js"></script>
  24. <script src="../_static/doctools.js"></script>
  25. <script src="../_static/sidebar.js"></script>
  26. <link rel="search" type="application/opensearchdescription+xml"
  27. title="Search within Python 3.12.0 documentation"
  28. href="../_static/opensearch.xml"/>
  29. <link rel="author" title="About these documents" href="../about.html" />
  30. <link rel="index" title="Index" href="../genindex.html" />
  31. <link rel="search" title="Search" href="../search.html" />
  32. <link rel="copyright" title="Copyright" href="../copyright.html" />
  33. <link rel="next" title="3. Configure Python" href="configure.html" />
  34. <link rel="prev" title="1. Command line and environment" href="cmdline.html" />
  35. <link rel="canonical" href="https://docs.python.org/3/using/unix.html" />
  36. <style>
  37. @media only screen {
  38. table.full-width-table {
  39. width: 100%;
  40. }
  41. }
  42. </style>
  43. <link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">
  44. <link rel="shortcut icon" type="image/png" href="../_static/py.svg" />
  45. <script type="text/javascript" src="../_static/copybutton.js"></script>
  46. <script type="text/javascript" src="../_static/menu.js"></script>
  47. <script type="text/javascript" src="../_static/themetoggle.js"></script>
  48. </head>
  49. <body>
  50. <div class="mobile-nav">
  51. <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"
  52. aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" />
  53. <nav class="nav-content" role="navigation">
  54. <label for="menuToggler" class="toggler__label">
  55. <span></span>
  56. </label>
  57. <span class="nav-items-wrapper">
  58. <a href="https://www.python.org/" class="nav-logo">
  59. <img src="../_static/py.svg" alt="Logo"/>
  60. </a>
  61. <span class="version_switcher_placeholder"></span>
  62. <form role="search" class="search" action="../search.html" method="get">
  63. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">
  64. <path fill-rule="nonzero" fill="currentColor" 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"></path>
  65. </svg>
  66. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  67. <input type="submit" value="Go"/>
  68. </form>
  69. </span>
  70. </nav>
  71. <div class="menu-wrapper">
  72. <nav class="menu" role="navigation" aria-label="main navigation">
  73. <div class="language_switcher_placeholder"></div>
  74. <label class="theme-selector-label">
  75. Theme
  76. <select class="theme-selector" oninput="activateTheme(this.value)">
  77. <option value="auto" selected>Auto</option>
  78. <option value="light">Light</option>
  79. <option value="dark">Dark</option>
  80. </select>
  81. </label>
  82. <div>
  83. <h3><a href="../contents.html">Table of Contents</a></h3>
  84. <ul>
  85. <li><a class="reference internal" href="#">2. Using Python on Unix platforms</a><ul>
  86. <li><a class="reference internal" href="#getting-and-installing-the-latest-version-of-python">2.1. Getting and installing the latest version of Python</a><ul>
  87. <li><a class="reference internal" href="#on-linux">2.1.1. On Linux</a></li>
  88. <li><a class="reference internal" href="#on-freebsd-and-openbsd">2.1.2. On FreeBSD and OpenBSD</a></li>
  89. </ul>
  90. </li>
  91. <li><a class="reference internal" href="#building-python">2.2. Building Python</a></li>
  92. <li><a class="reference internal" href="#python-related-paths-and-files">2.3. Python-related paths and files</a></li>
  93. <li><a class="reference internal" href="#miscellaneous">2.4. Miscellaneous</a></li>
  94. <li><a class="reference internal" href="#custom-openssl">2.5. Custom OpenSSL</a></li>
  95. </ul>
  96. </li>
  97. </ul>
  98. </div>
  99. <div>
  100. <h4>Previous topic</h4>
  101. <p class="topless"><a href="cmdline.html"
  102. title="previous chapter"><span class="section-number">1. </span>Command line and environment</a></p>
  103. </div>
  104. <div>
  105. <h4>Next topic</h4>
  106. <p class="topless"><a href="configure.html"
  107. title="next chapter"><span class="section-number">3. </span>Configure Python</a></p>
  108. </div>
  109. <div role="note" aria-label="source link">
  110. <h3>This Page</h3>
  111. <ul class="this-page-menu">
  112. <li><a href="../bugs.html">Report a Bug</a></li>
  113. <li>
  114. <a href="https://github.com/python/cpython/blob/main/Doc/using/unix.rst"
  115. rel="nofollow">Show Source
  116. </a>
  117. </li>
  118. </ul>
  119. </div>
  120. </nav>
  121. </div>
  122. </div>
  123. <div class="related" role="navigation" aria-label="related navigation">
  124. <h3>Navigation</h3>
  125. <ul>
  126. <li class="right" style="margin-right: 10px">
  127. <a href="../genindex.html" title="General Index"
  128. accesskey="I">index</a></li>
  129. <li class="right" >
  130. <a href="../py-modindex.html" title="Python Module Index"
  131. >modules</a> |</li>
  132. <li class="right" >
  133. <a href="configure.html" title="3. Configure Python"
  134. accesskey="N">next</a> |</li>
  135. <li class="right" >
  136. <a href="cmdline.html" title="1. Command line and environment"
  137. accesskey="P">previous</a> |</li>
  138. <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  139. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  140. <li class="switchers">
  141. <div class="language_switcher_placeholder"></div>
  142. <div class="version_switcher_placeholder"></div>
  143. </li>
  144. <li>
  145. </li>
  146. <li id="cpython-language-and-version">
  147. <a href="../index.html">3.12.0 Documentation</a> &#187;
  148. </li>
  149. <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Python Setup and Usage</a> &#187;</li>
  150. <li class="nav-item nav-item-this"><a href=""><span class="section-number">2. </span>Using Python on Unix platforms</a></li>
  151. <li class="right">
  152. <div class="inline-search" role="search">
  153. <form class="inline-search" action="../search.html" method="get">
  154. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  155. <input type="submit" value="Go" />
  156. </form>
  157. </div>
  158. |
  159. </li>
  160. <li class="right">
  161. <label class="theme-selector-label">
  162. Theme
  163. <select class="theme-selector" oninput="activateTheme(this.value)">
  164. <option value="auto" selected>Auto</option>
  165. <option value="light">Light</option>
  166. <option value="dark">Dark</option>
  167. </select>
  168. </label> |</li>
  169. </ul>
  170. </div>
  171. <div class="document">
  172. <div class="documentwrapper">
  173. <div class="bodywrapper">
  174. <div class="body" role="main">
  175. <section id="using-python-on-unix-platforms">
  176. <span id="using-on-unix"></span><h1><span class="section-number">2. </span>Using Python on Unix platforms<a class="headerlink" href="#using-python-on-unix-platforms" title="Permalink to this headline">¶</a></h1>
  177. <section id="getting-and-installing-the-latest-version-of-python">
  178. <h2><span class="section-number">2.1. </span>Getting and installing the latest version of Python<a class="headerlink" href="#getting-and-installing-the-latest-version-of-python" title="Permalink to this headline">¶</a></h2>
  179. <section id="on-linux">
  180. <h3><span class="section-number">2.1.1. </span>On Linux<a class="headerlink" href="#on-linux" title="Permalink to this headline">¶</a></h3>
  181. <p>Python comes preinstalled on most Linux distributions, and is available as a
  182. package on all others. However there are certain features you might want to use
  183. that are not available on your distro’s package. You can easily compile the
  184. latest version of Python from source.</p>
  185. <p>In the event that Python doesn’t come preinstalled and isn’t in the repositories as
  186. well, you can easily make packages for your own distro. Have a look at the
  187. following links:</p>
  188. <div class="admonition seealso">
  189. <p class="admonition-title">See also</p>
  190. <dl class="simple">
  191. <dt><a class="reference external" href="https://www.debian.org/doc/manuals/maint-guide/first.en.html">https://www.debian.org/doc/manuals/maint-guide/first.en.html</a></dt><dd><p>for Debian users</p>
  192. </dd>
  193. <dt><a class="reference external" href="https://en.opensuse.org/Portal:Packaging">https://en.opensuse.org/Portal:Packaging</a></dt><dd><p>for OpenSuse users</p>
  194. </dd>
  195. <dt><a class="reference external" href="https://docs.fedoraproject.org/en-US/package-maintainers/Packaging_Tutorial_GNU_Hello/">https://docs.fedoraproject.org/en-US/package-maintainers/Packaging_Tutorial_GNU_Hello/</a></dt><dd><p>for Fedora users</p>
  196. </dd>
  197. <dt><a class="reference external" href="https://slackbook.org/html/package-management-making-packages.html">https://slackbook.org/html/package-management-making-packages.html</a></dt><dd><p>for Slackware users</p>
  198. </dd>
  199. </dl>
  200. </div>
  201. </section>
  202. <section id="on-freebsd-and-openbsd">
  203. <h3><span class="section-number">2.1.2. </span>On FreeBSD and OpenBSD<a class="headerlink" href="#on-freebsd-and-openbsd" title="Permalink to this headline">¶</a></h3>
  204. <ul>
  205. <li><p>FreeBSD users, to add the package use:</p>
  206. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>pkg<span class="w"> </span>install<span class="w"> </span>python3
  207. </pre></div>
  208. </div>
  209. </li>
  210. <li><p>OpenBSD users, to add the package use:</p>
  211. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>pkg_add<span class="w"> </span>-r<span class="w"> </span>python
  212. pkg_add<span class="w"> </span>ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/&lt;insert<span class="w"> </span>your<span class="w"> </span>architecture<span class="w"> </span>here&gt;/python-&lt;version&gt;.tgz
  213. </pre></div>
  214. </div>
  215. <p>For example i386 users get the 2.5.1 version of Python using:</p>
  216. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>pkg_add<span class="w"> </span>ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2.tgz
  217. </pre></div>
  218. </div>
  219. </li>
  220. </ul>
  221. </section>
  222. </section>
  223. <section id="building-python">
  224. <span id="building-python-on-unix"></span><h2><span class="section-number">2.2. </span>Building Python<a class="headerlink" href="#building-python" title="Permalink to this headline">¶</a></h2>
  225. <p>If you want to compile CPython yourself, first thing you should do is get the
  226. <a class="reference external" href="https://www.python.org/downloads/source/">source</a>. You can download either the
  227. latest release’s source or just grab a fresh <a class="reference external" href="https://devguide.python.org/setup/#get-the-source-code">clone</a>. (If you want
  228. to contribute patches, you will need a clone.)</p>
  229. <p>The build process consists of the usual commands:</p>
  230. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>./configure
  231. make
  232. make<span class="w"> </span>install
  233. </pre></div>
  234. </div>
  235. <p><a class="reference internal" href="configure.html#configure-options"><span class="std std-ref">Configuration options</span></a> and caveats for specific Unix
  236. platforms are extensively documented in the <a class="reference external" href="https://github.com/python/cpython/tree/3.12/README.rst">README.rst</a> file in the
  237. root of the Python source tree.</p>
  238. <div class="admonition warning">
  239. <p class="admonition-title">Warning</p>
  240. <p><code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">install</span></code> can overwrite or masquerade the <code class="file docutils literal notranslate"><span class="pre">python3</span></code> binary.
  241. <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">altinstall</span></code> is therefore recommended instead of <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">install</span></code>
  242. since it only installs <code class="file docutils literal notranslate"><em><span class="pre">exec_prefix</span></em><span class="pre">/bin/python</span><em><span class="pre">version</span></em></code>.</p>
  243. </div>
  244. </section>
  245. <section id="python-related-paths-and-files">
  246. <h2><span class="section-number">2.3. </span>Python-related paths and files<a class="headerlink" href="#python-related-paths-and-files" title="Permalink to this headline">¶</a></h2>
  247. <p>These are subject to difference depending on local installation conventions;
  248. <a class="reference internal" href="configure.html#cmdoption-prefix"><code class="xref std std-option docutils literal notranslate"><span class="pre">prefix</span></code></a> and <a class="reference internal" href="configure.html#cmdoption-exec-prefix"><code class="xref std std-option docutils literal notranslate"><span class="pre">exec_prefix</span></code></a>
  249. are installation-dependent and should be interpreted as for GNU software; they
  250. may be the same.</p>
  251. <p>For example, on most Linux systems, the default for both is <code class="file docutils literal notranslate"><span class="pre">/usr</span></code>.</p>
  252. <table class="docutils align-default">
  253. <colgroup>
  254. <col style="width: 53%" />
  255. <col style="width: 47%" />
  256. </colgroup>
  257. <thead>
  258. <tr class="row-odd"><th class="head"><p>File/directory</p></th>
  259. <th class="head"><p>Meaning</p></th>
  260. </tr>
  261. </thead>
  262. <tbody>
  263. <tr class="row-even"><td><p><code class="file docutils literal notranslate"><em><span class="pre">exec_prefix</span></em><span class="pre">/bin/python3</span></code></p></td>
  264. <td><p>Recommended location of the interpreter.</p></td>
  265. </tr>
  266. <tr class="row-odd"><td><p><code class="file docutils literal notranslate"><em><span class="pre">prefix</span></em><span class="pre">/lib/python</span><em><span class="pre">version</span></em></code>,
  267. <code class="file docutils literal notranslate"><em><span class="pre">exec_prefix</span></em><span class="pre">/lib/python</span><em><span class="pre">version</span></em></code></p></td>
  268. <td><p>Recommended locations of the directories
  269. containing the standard modules.</p></td>
  270. </tr>
  271. <tr class="row-even"><td><p><code class="file docutils literal notranslate"><em><span class="pre">prefix</span></em><span class="pre">/include/python</span><em><span class="pre">version</span></em></code>,
  272. <code class="file docutils literal notranslate"><em><span class="pre">exec_prefix</span></em><span class="pre">/include/python</span><em><span class="pre">version</span></em></code></p></td>
  273. <td><p>Recommended locations of the directories
  274. containing the include files needed for
  275. developing Python extensions and
  276. embedding the interpreter.</p></td>
  277. </tr>
  278. </tbody>
  279. </table>
  280. </section>
  281. <section id="miscellaneous">
  282. <h2><span class="section-number">2.4. </span>Miscellaneous<a class="headerlink" href="#miscellaneous" title="Permalink to this headline">¶</a></h2>
  283. <p>To easily use Python scripts on Unix, you need to make them executable,
  284. e.g. with</p>
  285. <div class="highlight-shell-session notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>chmod<span class="w"> </span>+x<span class="w"> </span>script
  286. </pre></div>
  287. </div>
  288. <p>and put an appropriate Shebang line at the top of the script. A good choice is
  289. usually</p>
  290. <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="ch">#!/usr/bin/env python3</span>
  291. </pre></div>
  292. </div>
  293. <p>which searches for the Python interpreter in the whole <span class="target" id="index-0"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code>. However,
  294. some Unices may not have the <strong class="program">env</strong> command, so you may need to hardcode
  295. <code class="docutils literal notranslate"><span class="pre">/usr/bin/python3</span></code> as the interpreter path.</p>
  296. <p>To use shell commands in your Python scripts, look at the <a class="reference internal" href="../library/subprocess.html#module-subprocess" title="subprocess: Subprocess management."><code class="xref py py-mod docutils literal notranslate"><span class="pre">subprocess</span></code></a> module.</p>
  297. </section>
  298. <section id="custom-openssl">
  299. <span id="unix-custom-openssl"></span><h2><span class="section-number">2.5. </span>Custom OpenSSL<a class="headerlink" href="#custom-openssl" title="Permalink to this headline">¶</a></h2>
  300. <ol class="arabic">
  301. <li><p>To use your vendor’s OpenSSL configuration and system trust store, locate
  302. the directory with <code class="docutils literal notranslate"><span class="pre">openssl.cnf</span></code> file or symlink in <code class="docutils literal notranslate"><span class="pre">/etc</span></code>. On most
  303. distribution the file is either in <code class="docutils literal notranslate"><span class="pre">/etc/ssl</span></code> or <code class="docutils literal notranslate"><span class="pre">/etc/pki/tls</span></code>. The
  304. directory should also contain a <code class="docutils literal notranslate"><span class="pre">cert.pem</span></code> file and/or a <code class="docutils literal notranslate"><span class="pre">certs</span></code>
  305. directory.</p>
  306. <div class="highlight-shell-session notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>find<span class="w"> </span>/etc/<span class="w"> </span>-name<span class="w"> </span>openssl.cnf<span class="w"> </span>-printf<span class="w"> </span><span class="s2">&quot;%h\n&quot;</span>
  307. <span class="go">/etc/ssl</span>
  308. </pre></div>
  309. </div>
  310. </li>
  311. <li><p>Download, build, and install OpenSSL. Make sure you use <code class="docutils literal notranslate"><span class="pre">install_sw</span></code> and
  312. not <code class="docutils literal notranslate"><span class="pre">install</span></code>. The <code class="docutils literal notranslate"><span class="pre">install_sw</span></code> target does not override
  313. <code class="docutils literal notranslate"><span class="pre">openssl.cnf</span></code>.</p>
  314. <div class="highlight-shell-session notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>curl<span class="w"> </span>-O<span class="w"> </span>https://www.openssl.org/source/openssl-VERSION.tar.gz
  315. <span class="gp">$ </span>tar<span class="w"> </span>xzf<span class="w"> </span>openssl-VERSION
  316. <span class="gp">$ </span><span class="nb">pushd</span><span class="w"> </span>openssl-VERSION
  317. <span class="gp">$ </span>./config<span class="w"> </span><span class="se">\</span>
  318. <span class="w"> </span>--prefix<span class="o">=</span>/usr/local/custom-openssl<span class="w"> </span><span class="se">\</span>
  319. <span class="w"> </span>--libdir<span class="o">=</span>lib<span class="w"> </span><span class="se">\</span>
  320. <span class="w"> </span>--openssldir<span class="o">=</span>/etc/ssl
  321. <span class="gp">$ </span>make<span class="w"> </span>-j1<span class="w"> </span>depend
  322. <span class="gp">$ </span>make<span class="w"> </span>-j8
  323. <span class="gp">$ </span>make<span class="w"> </span>install_sw
  324. <span class="gp">$ </span><span class="nb">popd</span>
  325. </pre></div>
  326. </div>
  327. </li>
  328. <li><p>Build Python with custom OpenSSL
  329. (see the configure <code class="docutils literal notranslate"><span class="pre">--with-openssl</span></code> and <code class="docutils literal notranslate"><span class="pre">--with-openssl-rpath</span></code> options)</p>
  330. <div class="highlight-shell-session notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">pushd</span><span class="w"> </span>python-3.x.x
  331. <span class="gp">$ </span>./configure<span class="w"> </span>-C<span class="w"> </span><span class="se">\</span>
  332. <span class="w"> </span>--with-openssl<span class="o">=</span>/usr/local/custom-openssl<span class="w"> </span><span class="se">\</span>
  333. <span class="w"> </span>--with-openssl-rpath<span class="o">=</span>auto<span class="w"> </span><span class="se">\</span>
  334. <span class="w"> </span>--prefix<span class="o">=</span>/usr/local/python-3.x.x
  335. <span class="gp">$ </span>make<span class="w"> </span>-j8
  336. <span class="gp">$ </span>make<span class="w"> </span>altinstall
  337. </pre></div>
  338. </div>
  339. </li>
  340. </ol>
  341. <div class="admonition note">
  342. <p class="admonition-title">Note</p>
  343. <p>Patch releases of OpenSSL have a backwards compatible ABI. You don’t need
  344. to recompile Python to update OpenSSL. It’s sufficient to replace the
  345. custom OpenSSL installation with a newer version.</p>
  346. </div>
  347. </section>
  348. </section>
  349. <div class="clearer"></div>
  350. </div>
  351. </div>
  352. </div>
  353. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  354. <div class="sphinxsidebarwrapper">
  355. <div>
  356. <h3><a href="../contents.html">Table of Contents</a></h3>
  357. <ul>
  358. <li><a class="reference internal" href="#">2. Using Python on Unix platforms</a><ul>
  359. <li><a class="reference internal" href="#getting-and-installing-the-latest-version-of-python">2.1. Getting and installing the latest version of Python</a><ul>
  360. <li><a class="reference internal" href="#on-linux">2.1.1. On Linux</a></li>
  361. <li><a class="reference internal" href="#on-freebsd-and-openbsd">2.1.2. On FreeBSD and OpenBSD</a></li>
  362. </ul>
  363. </li>
  364. <li><a class="reference internal" href="#building-python">2.2. Building Python</a></li>
  365. <li><a class="reference internal" href="#python-related-paths-and-files">2.3. Python-related paths and files</a></li>
  366. <li><a class="reference internal" href="#miscellaneous">2.4. Miscellaneous</a></li>
  367. <li><a class="reference internal" href="#custom-openssl">2.5. Custom OpenSSL</a></li>
  368. </ul>
  369. </li>
  370. </ul>
  371. </div>
  372. <div>
  373. <h4>Previous topic</h4>
  374. <p class="topless"><a href="cmdline.html"
  375. title="previous chapter"><span class="section-number">1. </span>Command line and environment</a></p>
  376. </div>
  377. <div>
  378. <h4>Next topic</h4>
  379. <p class="topless"><a href="configure.html"
  380. title="next chapter"><span class="section-number">3. </span>Configure Python</a></p>
  381. </div>
  382. <div role="note" aria-label="source link">
  383. <h3>This Page</h3>
  384. <ul class="this-page-menu">
  385. <li><a href="../bugs.html">Report a Bug</a></li>
  386. <li>
  387. <a href="https://github.com/python/cpython/blob/main/Doc/using/unix.rst"
  388. rel="nofollow">Show Source
  389. </a>
  390. </li>
  391. </ul>
  392. </div>
  393. </div>
  394. </div>
  395. <div class="clearer"></div>
  396. </div>
  397. <div class="related" role="navigation" aria-label="related navigation">
  398. <h3>Navigation</h3>
  399. <ul>
  400. <li class="right" style="margin-right: 10px">
  401. <a href="../genindex.html" title="General Index"
  402. >index</a></li>
  403. <li class="right" >
  404. <a href="../py-modindex.html" title="Python Module Index"
  405. >modules</a> |</li>
  406. <li class="right" >
  407. <a href="configure.html" title="3. Configure Python"
  408. >next</a> |</li>
  409. <li class="right" >
  410. <a href="cmdline.html" title="1. Command line and environment"
  411. >previous</a> |</li>
  412. <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  413. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  414. <li class="switchers">
  415. <div class="language_switcher_placeholder"></div>
  416. <div class="version_switcher_placeholder"></div>
  417. </li>
  418. <li>
  419. </li>
  420. <li id="cpython-language-and-version">
  421. <a href="../index.html">3.12.0 Documentation</a> &#187;
  422. </li>
  423. <li class="nav-item nav-item-1"><a href="index.html" >Python Setup and Usage</a> &#187;</li>
  424. <li class="nav-item nav-item-this"><a href=""><span class="section-number">2. </span>Using Python on Unix platforms</a></li>
  425. <li class="right">
  426. <div class="inline-search" role="search">
  427. <form class="inline-search" action="../search.html" method="get">
  428. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  429. <input type="submit" value="Go" />
  430. </form>
  431. </div>
  432. |
  433. </li>
  434. <li class="right">
  435. <label class="theme-selector-label">
  436. Theme
  437. <select class="theme-selector" oninput="activateTheme(this.value)">
  438. <option value="auto" selected>Auto</option>
  439. <option value="light">Light</option>
  440. <option value="dark">Dark</option>
  441. </select>
  442. </label> |</li>
  443. </ul>
  444. </div>
  445. <div class="footer">
  446. &copy; <a href="../copyright.html">Copyright</a> 2001-2023, Python Software Foundation.
  447. <br />
  448. This page is licensed under the Python Software Foundation License Version 2.
  449. <br />
  450. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
  451. <br />
  452. See <a href="/license.html">History and License</a> for more information.<br />
  453. <br />
  454. The Python Software Foundation is a non-profit corporation.
  455. <a href="https://www.python.org/psf/donations/">Please donate.</a>
  456. <br />
  457. <br />
  458. Last updated on Oct 02, 2023.
  459. <a href="/bugs.html">Found a bug</a>?
  460. <br />
  461. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
  462. </div>
  463. </body>
  464. </html>