{"id":605,"date":"2025-08-14T11:40:12","date_gmt":"2025-08-14T03:40:12","guid":{"rendered":"https:\/\/www.armbian.net\/?p=605"},"modified":"2025-08-14T12:01:55","modified_gmt":"2025-08-14T04:01:55","slug":"python-2","status":"publish","type":"post","link":"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/","title":{"rendered":"\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5python"},"content":{"rendered":"<p><!-- \u6e90\u7801\u7f16\u8bd1\u5b89\u88c5 Python 3.9\uff08ARM64\u9002\u7528\uff09 WordPress \u7f16\u8f91\u5668\u53cb\u597d\u6392\u7248\uff0c\u79fb\u52a8\u7aef\u9002\u914d --><\/p>\n<article style=\"width: 60vw; max-width: 500vw; margin: 0; padding: 0; background: #fff;\">\n<div class=\"py39-steps\">\n<h2>\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5 Python \uff08\u4ee5python3.9\u4e3a\u4f8b\uff09<\/h2>\n<ol>\n<li><strong>\u5b89\u88c5\u7f16\u8bd1\u4f9d\u8d56<\/strong>\n<pre><code>sudo apt update\r\nsudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev<\/code><\/pre>\n<\/li>\n<li><strong>\u4e0b\u8f7d Python 3.9 \u6e90\u7801<\/strong>\n<pre><code>wget https:\/\/www.python.org\/ftp\/python\/3.9.18\/Python-3.9.18.tgz\r\ntar -xzf Python-3.9.18.tgz\r\ncd Python-3.9.18\r\n\u4e5f\u53ef\u4ee5\u66ff\u6362\u6210\u5176\u4ed6python\u7248\u672c\uff1ahttps:\/\/www.python.org\/ftp\/python\/<\/code><\/pre>\n<\/li>\n<li><strong>\u914d\u7f6e\u7f16\u8bd1\u53c2\u6570\uff08ARM64\u9700\u989d\u5916\u4f18\u5316\uff09<\/strong>\n<pre><code>.\/configure \\\r\n  --enable-optimizations \\\r\n  --enable-shared \\\r\n  --with-system-ffi \\\r\n  --with-ensurepip=install \\\r\n  LDFLAGS=\"-L\/usr\/lib\/aarch64-linux-gnu\"<\/code><\/pre>\n<\/li>\n<li><strong>\u7f16\u8bd1\u5e76\u5b89\u88c5\uff08\u4f7f\u7528 altinstall \u907f\u514d\u8986\u76d6\u7cfb\u7edf Python\uff09<\/strong>\n<pre><code>make -j$(nproc)\r\nsudo make altinstall<\/code><\/pre>\n<\/li>\n<li><strong>\u89e3\u51b3\u5171\u4eab\u5e93\u95ee\u9898<\/strong>\n<pre><code>sudo ldconfig<\/code><\/pre>\n<\/li>\n<li><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong>\n<pre><code>python3.9 --version  # \u5e94\u663e\u793a Python 3.9.18<\/code><\/pre>\n<\/li>\n<\/ol>\n<h3>\u5173\u952e\u6b65\u9aa4\u8bf4\u660e<\/h3>\n<div class=\"tip\">\n<ul style=\"margin-bottom: 0;\">\n<li><strong>&#8211;enable-shared \u53c2\u6570\uff1a<\/strong><br \/>\n\u751f\u6210\u52a8\u6001\u94fe\u63a5\u5e93\uff08.so \u6587\u4ef6\uff09\uff0c\u907f\u514d\u540e\u7eed\u51fa\u73b0 <code>libpython not found<\/code> \u9519\u8bef\u3002<\/li>\n<li><strong>LDFLAGS \u989d\u5916\u914d\u7f6e\uff1a<\/strong><br \/>\n\u9488\u5bf9 ARM64 \u67b6\u6784\u6307\u5b9a\u5e93\u6587\u4ef6\u8def\u5f84\uff0c\u89e3\u51b3\u94fe\u63a5\u95ee\u9898\u3002<\/li>\n<li><strong>make altinstall\uff1a<\/strong><br \/>\n\u4fdd\u7559\u7cfb\u7edf\u9ed8\u8ba4\u7684 Python 3.6\uff08Ubuntu 18.04 \u4f9d\u8d56\u5b83\uff09\uff0c\u65b0\u7248\u672c\u901a\u8fc7 <code>python3.9<\/code> \u8c03\u7528\u3002<\/li>\n<\/ul>\n<\/div>\n<h3>\u5b89\u88c5\u540e\u914d\u7f6e<\/h3>\n<ol>\n<li><strong>\u4fee\u590d pip \u5173\u8054<\/strong>\n<pre><code>python3.9 -m pip install --upgrade pip<\/code><\/pre>\n<\/li>\n<li><strong>\u4f7f\u7528\u793a\u4f8b<\/strong>\n<pre><code>python3.9 -m pip install numpy<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/div>\n<\/article>\n<style><style>\r\n    .py39-steps {\r\n      width: 100vw;\r\n      max-width: 100vw;\r\n      margin: 0;\r\n      padding: 0 0 2em 0;\r\n      font-family: system-ui,sans-serif;\r\n      line-height: 1.8;\r\n      background: #fff;\r\n      border-radius: 0;\r\n      box-shadow: none;\r\n      box-sizing: border-box;\r\n    }\r\n    @media (min-width: 700px) {\r\n      .py39-steps {\r\n        width: 700px;\r\n        max-width: 700px;\r\n        margin: 2em auto;\r\n        padding: 2em 1.2em 2em 1.2em;\r\n        border-radius: 14px;\r\n        box-shadow: 0 4px 24px #0002;\r\n      }\r\n    }\r\n    .py39-steps code, .py39-steps pre { font-family: 'JetBrains Mono', 'Fira Mono', 'Consolas', 'Menlo', monospace; }\r\n    .py39-steps pre {\r\n      background: linear-gradient(90deg,#f8fafc 80%,#e9f5ec 100%);\r\n      border-radius: 8px;\r\n      padding: 1em 1em 1em 1.2em;\r\n      margin: 0.5em 0 1em 0;\r\n      overflow-x: auto;\r\n      font-size: 1.05em;\r\n      border: 1px solid #e0e0e0;\r\n      box-shadow: 0 1px 4px #0001;\r\n    }\r\n    .py39-steps h2 {\r\n      color: #219150;\r\n      font-size: 1.7em;\r\n      margin-top: 0;\r\n      margin-bottom: 0.7em;\r\n      letter-spacing: 0.01em;\r\n      font-weight: 700;\r\n    }\r\n    .py39-steps h3 {\r\n      color: #40916c;\r\n      font-size: 1.15em;\r\n      margin-top: 2em;\r\n      margin-bottom: 0.7em;\r\n      font-weight: 600;\r\n    }\r\n    .py39-steps ol, .py39-steps ul {\r\n      padding-left: 1.2em;\r\n      margin-bottom: 1.5em;\r\n    }\r\n    .py39-steps li {\r\n      margin-bottom: 0.7em;\r\n    }\r\n    .py39-steps strong {\r\n      color: #1b4332;\r\n      font-weight: 600;\r\n    }\r\n    .py39-steps .tip {\r\n      background: #e9f5ec;\r\n      border-left: 4px solid #52b788;\r\n      padding: 0.7em 1em;\r\n      border-radius: 6px;\r\n      margin: 1em 0;\r\n      color: #24543a;\r\n      font-size: 1em;\r\n    }\r\n    @media (max-width: 600px) {\r\n      .py39-steps {\r\n        padding: 0.5em 0.2em 2em 0.2em !important;\r\n        border-radius: 0 !important;\r\n        box-shadow: none !important;\r\n      }\r\n      .py39-steps h2, .py39-steps h3 { font-size: 1.15em !important; }\r\n      .py39-steps pre { font-size: 0.95em !important; }\r\n    }\r\n  <\/style><\/style>","protected":false},"excerpt":{"rendered":"<p>\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5 Python \uff08\u4ee5python3.9\u4e3a\u4f8b\uff09 \u5b89\u88c5\u7f16\u8bd1\u4f9d\u8d56 sudo apt update sud [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-605","post","type-post","status-publish","format-standard","hentry","category-5"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5python - armbian\u670d\u52a1\u5668\u7cfb\u7edf<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5python - armbian\u670d\u52a1\u5668\u7cfb\u7edf\" \/>\n<meta property=\"og:description\" content=\"\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5 Python \uff08\u4ee5python3.9\u4e3a\u4f8b\uff09 \u5b89\u88c5\u7f16\u8bd1\u4f9d\u8d56 sudo apt update sud [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/\" \/>\n<meta property=\"og:site_name\" content=\"armbian\u670d\u52a1\u5668\u7cfb\u7edf\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-14T03:40:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-14T04:01:55+00:00\" \/>\n<meta name=\"author\" content=\"2668171712\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"2668171712\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/\"},\"author\":{\"name\":\"2668171712\",\"@id\":\"https:\/\/www.armbian.net\/#\/schema\/person\/6ac5fb3503d4a20a36431ff5b0d3e542\"},\"headline\":\"\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5python\",\"datePublished\":\"2025-08-14T03:40:12+00:00\",\"dateModified\":\"2025-08-14T04:01:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/\"},\"wordCount\":16,\"publisher\":{\"@id\":\"https:\/\/www.armbian.net\/#\/schema\/person\/6ac5fb3503d4a20a36431ff5b0d3e542\"},\"articleSection\":[\"\u7f16\u7a0b\u8bed\u8a00\u73af\u5883\u5b89\u88c5\"],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/\",\"url\":\"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/\",\"name\":\"\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5python - armbian\u670d\u52a1\u5668\u7cfb\u7edf\",\"isPartOf\":{\"@id\":\"https:\/\/www.armbian.net\/#website\"},\"datePublished\":\"2025-08-14T03:40:12+00:00\",\"dateModified\":\"2025-08-14T04:01:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.armbian.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.armbian.net\/#website\",\"url\":\"https:\/\/www.armbian.net\/\",\"name\":\"armbian\u670d\u52a1\u5668\u7cfb\u7edf\",\"description\":\"armbian \u8ba9\u4e07\u7269\u91cd\u65b0\u91ca\u653e\u4ef7\u503c\uff0c\u4e3a\u4e86\u65e0\u6cd5\u66ff\u4ee3\u7684\u4ef7\u503c\",\"publisher\":{\"@id\":\"https:\/\/www.armbian.net\/#\/schema\/person\/6ac5fb3503d4a20a36431ff5b0d3e542\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.armbian.net\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.armbian.net\/#\/schema\/person\/6ac5fb3503d4a20a36431ff5b0d3e542\",\"name\":\"2668171712\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.armbian.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.armbian.net\/wp-content\/uploads\/2023\/03\/cropped-\u5c0f\u73a9\u9b54\u76d2.png\",\"contentUrl\":\"https:\/\/www.armbian.net\/wp-content\/uploads\/2023\/03\/cropped-\u5c0f\u73a9\u9b54\u76d2.png\",\"width\":512,\"height\":512,\"caption\":\"2668171712\"},\"logo\":{\"@id\":\"https:\/\/www.armbian.net\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.armbian.net\"],\"url\":\"https:\/\/www.armbian.net\/index.php\/author\/2668171712\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5python - armbian\u670d\u52a1\u5668\u7cfb\u7edf","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/","og_locale":"zh_CN","og_type":"article","og_title":"\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5python - armbian\u670d\u52a1\u5668\u7cfb\u7edf","og_description":"\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5 Python \uff08\u4ee5python3.9\u4e3a\u4f8b\uff09 \u5b89\u88c5\u7f16\u8bd1\u4f9d\u8d56 sudo apt update sud [&hellip;]","og_url":"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/","og_site_name":"armbian\u670d\u52a1\u5668\u7cfb\u7edf","article_published_time":"2025-08-14T03:40:12+00:00","article_modified_time":"2025-08-14T04:01:55+00:00","author":"2668171712","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"2668171712","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/#article","isPartOf":{"@id":"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/"},"author":{"name":"2668171712","@id":"https:\/\/www.armbian.net\/#\/schema\/person\/6ac5fb3503d4a20a36431ff5b0d3e542"},"headline":"\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5python","datePublished":"2025-08-14T03:40:12+00:00","dateModified":"2025-08-14T04:01:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/"},"wordCount":16,"publisher":{"@id":"https:\/\/www.armbian.net\/#\/schema\/person\/6ac5fb3503d4a20a36431ff5b0d3e542"},"articleSection":["\u7f16\u7a0b\u8bed\u8a00\u73af\u5883\u5b89\u88c5"],"inLanguage":"zh-Hans"},{"@type":"WebPage","@id":"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/","url":"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/","name":"\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5python - armbian\u670d\u52a1\u5668\u7cfb\u7edf","isPartOf":{"@id":"https:\/\/www.armbian.net\/#website"},"datePublished":"2025-08-14T03:40:12+00:00","dateModified":"2025-08-14T04:01:55+00:00","breadcrumb":{"@id":"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.armbian.net\/index.php\/2025\/08\/14\/python-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.armbian.net\/"},{"@type":"ListItem","position":2,"name":"\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5python"}]},{"@type":"WebSite","@id":"https:\/\/www.armbian.net\/#website","url":"https:\/\/www.armbian.net\/","name":"armbian\u670d\u52a1\u5668\u7cfb\u7edf","description":"armbian \u8ba9\u4e07\u7269\u91cd\u65b0\u91ca\u653e\u4ef7\u503c\uff0c\u4e3a\u4e86\u65e0\u6cd5\u66ff\u4ee3\u7684\u4ef7\u503c","publisher":{"@id":"https:\/\/www.armbian.net\/#\/schema\/person\/6ac5fb3503d4a20a36431ff5b0d3e542"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.armbian.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/www.armbian.net\/#\/schema\/person\/6ac5fb3503d4a20a36431ff5b0d3e542","name":"2668171712","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.armbian.net\/#\/schema\/person\/image\/","url":"https:\/\/www.armbian.net\/wp-content\/uploads\/2023\/03\/cropped-\u5c0f\u73a9\u9b54\u76d2.png","contentUrl":"https:\/\/www.armbian.net\/wp-content\/uploads\/2023\/03\/cropped-\u5c0f\u73a9\u9b54\u76d2.png","width":512,"height":512,"caption":"2668171712"},"logo":{"@id":"https:\/\/www.armbian.net\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.armbian.net"],"url":"https:\/\/www.armbian.net\/index.php\/author\/2668171712\/"}]}},"views":1621,"_links":{"self":[{"href":"https:\/\/www.armbian.net\/index.php\/wp-json\/wp\/v2\/posts\/605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.armbian.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.armbian.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.armbian.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.armbian.net\/index.php\/wp-json\/wp\/v2\/comments?post=605"}],"version-history":[{"count":5,"href":"https:\/\/www.armbian.net\/index.php\/wp-json\/wp\/v2\/posts\/605\/revisions"}],"predecessor-version":[{"id":612,"href":"https:\/\/www.armbian.net\/index.php\/wp-json\/wp\/v2\/posts\/605\/revisions\/612"}],"wp:attachment":[{"href":"https:\/\/www.armbian.net\/index.php\/wp-json\/wp\/v2\/media?parent=605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.armbian.net\/index.php\/wp-json\/wp\/v2\/categories?post=605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.armbian.net\/index.php\/wp-json\/wp\/v2\/tags?post=605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}