{"id":1013423,"date":"2024-12-27T11:47:51","date_gmt":"2024-12-27T03:47:51","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1013423.html"},"modified":"2024-12-27T11:47:54","modified_gmt":"2024-12-27T03:47:54","slug":"%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85python3-5-4","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1013423.html","title":{"rendered":"\u5982\u4f55\u5b89\u88c5python3.5.4"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25090846\/2191f0e9-e636-4277-8e11-18938dd2241f.webp\" alt=\"\u5982\u4f55\u5b89\u88c5python3.5.4\" \/><\/p>\n<p><p> <strong>\u8981\u5b89\u88c5Python 3.5.4\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u60a8\u7684\u7cfb\u7edf\u6ee1\u8db3\u5b89\u88c5\u8981\u6c42\u3001\u4e0b\u8f7d\u6b63\u786e\u7684\u5b89\u88c5\u5305\u3001\u6b63\u786e\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u5e76\u8fdb\u884c\u6d4b\u8bd5\u4ee5\u786e\u4fdd\u5b89\u88c5\u6210\u529f\u3002<\/strong>\u4ee5\u4e0b\u662f\u8be6\u7ec6\u7684\u5b89\u88c5\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u68c0\u67e5\u7cfb\u7edf\u8981\u6c42<\/p>\n<\/p>\n<p><p>\u5728\u5b89\u88c5Python 3.5.4\u4e4b\u524d\uff0c\u9996\u5148\u8981\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u6ee1\u8db3Python\u7684\u6700\u4f4e\u8981\u6c42\u3002Python 3.5.4\u652f\u6301\u5927\u591a\u6570\u73b0\u4ee3\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5305\u62ecWindows\u3001macOS\u548c\u5927\u90e8\u5206Linux\u53d1\u884c\u7248\u3002\u786e\u4fdd\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\u662f64\u4f4d\u621632\u4f4d\u7248\u672c\uff0c\u5e76\u4e0b\u8f7d\u5bf9\u5e94\u7684Python\u5b89\u88c5\u5305\u3002Windows\u7528\u6237\u9700\u8981\u81f3\u5c11Windows 7\u53ca\u4ee5\u4e0a\u7248\u672c\uff0c\u800cmacOS\u7528\u6237\u5219\u9700\u8981OS X 10.6\u53ca\u4ee5\u4e0a\u7248\u672c\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4e0b\u8f7dPython 3.5.4<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bbf\u95ee\u5b98\u65b9\u7f51\u7ad9<\/strong>\uff1a\u524d\u5f80Python\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/%EF%BC%89%E5%B9%B6%E8%BF%9B%E5%85%A5%E4%B8%8B%E8%BD%BD%E9%A1%B5%E9%9D%A2%E3%80%82%E5%9C%A8%E9%A1%B5%E9%9D%A2%E4%B8%AD%EF%BC%8C%E4%BD%A0%E4%BC%9A%E7%9C%8B%E5%88%B0%E5%A4%9A%E4%B8%AAPython%E7%89%88%E6%9C%AC%E7%9A%84%E4%B8%8B%E8%BD%BD%E9%93%BE%E6%8E%A5%E3%80%82%E7%94%B1%E4%BA%8EPython\">https:\/\/www.python.org\/\uff09\u5e76\u8fdb\u5165\u4e0b\u8f7d\u9875\u9762\u3002\u5728\u9875\u9762\u4e2d\uff0c\u4f60\u4f1a\u770b\u5230\u591a\u4e2aPython\u7248\u672c\u7684\u4e0b\u8f7d\u94fe\u63a5\u3002\u7531\u4e8ePython<\/a> 3.5.4\u5df2\u7ecf\u4e0d\u662f\u6700\u65b0\u7248\u672c\uff0c\u56e0\u6b64\u9700\u8981\u70b9\u51fb\u201cView older releases\u201d\u94fe\u63a5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9009\u62e9\u9002\u5408\u7684\u5b89\u88c5\u5305<\/strong>\uff1a\u6839\u636e\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u9009\u62e9\u5408\u9002\u7684\u5b89\u88c5\u5305\u3002\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fWindows\uff0c\u9009\u62e9\u201c.exe\u201d\u6587\u4ef6\uff1b\u5bf9\u4e8emacOS\uff0c\u9009\u62e9\u201c.pkg\u201d\u6587\u4ef6\uff1bLinux\u7528\u6237\u5219\u53ef\u4ee5\u4e0b\u8f7d\u201c.tar.xz\u201d\u6e90\u4ee3\u7801\u5305\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u5b89\u88c5Python 3.5.4<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Windows\u5b89\u88c5<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u53cc\u51fb\u4e0b\u8f7d\u7684\u201c.exe\u201d\u5b89\u88c5\u6587\u4ef6\u3002<\/li>\n<li>\u52fe\u9009\u201cAdd Python 3.5 to PATH\u201d\u9009\u9879\uff0c\u4ee5\u4fbf\u81ea\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<li>\u70b9\u51fb\u201cInstall Now\u201d\u8fdb\u884c\u9ed8\u8ba4\u5b89\u88c5\uff0c\u6216\u9009\u62e9\u201cCustomize installation\u201d\u8fdb\u884c\u81ea\u5b9a\u4e49\u5b89\u88c5\u3002<\/li>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165<code>python --version<\/code>\uff0c\u786e\u4fdd\u5b89\u88c5\u6210\u529f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>macOS\u5b89\u88c5<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u53cc\u51fb\u4e0b\u8f7d\u7684\u201c.pkg\u201d\u6587\u4ef6\uff0c\u542f\u52a8\u5b89\u88c5\u5411\u5bfc\u3002<\/li>\n<li>\u6309\u7167\u63d0\u793a\u8fdb\u884c\u5b89\u88c5\uff0c\u901a\u5e38\u53ea\u9700\u70b9\u51fb\u201c\u7ee7\u7eed\u201d\u548c\u201c\u5b89\u88c5\u201d\u3002<\/li>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165<code>python3 --version<\/code>\uff0c\u9a8c\u8bc1\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Linux\u5b89\u88c5<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u89e3\u538b\u4e0b\u8f7d\u7684\u201c.tar.xz\u201d\u6587\u4ef6\uff1a<code>tar -xf Python-3.5.4.tar.xz<\/code><\/li>\n<li>\u8fdb\u5165\u89e3\u538b\u540e\u7684\u76ee\u5f55\uff1a<code>cd Python-3.5.4<\/code><\/li>\n<li>\u914d\u7f6e\u7f16\u8bd1\u73af\u5883\uff1a<code>.\/configure --enable-optimizations<\/code><\/li>\n<li>\u7f16\u8bd1\u5e76\u5b89\u88c5\uff1a<code>make &amp;&amp; sudo make install<\/code><\/li>\n<li>\u5b8c\u6210\u540e\uff0c\u8f93\u5165<code>python3.5 --version<\/code>\u4ee5\u786e\u8ba4\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8eWindows\u7528\u6237\uff0c\u5982\u679c\u5728\u5b89\u88c5\u65f6\u6ca1\u6709\u52fe\u9009\u201cAdd Python 3.5 to PATH\u201d\uff0c\u5219\u9700\u8981\u624b\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u53f3\u952e\u201c\u6b64\u7535\u8111\u201d\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\u3002<\/li>\n<li>\u70b9\u51fb\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u5bf9\u8bdd\u6846\u4e2d\uff0c\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u4e2d\uff0c\u627e\u5230\u201cPath\u201d\uff0c\u70b9\u51fb\u201c\u7f16\u8f91\u201d\u3002<\/li>\n<li>\u70b9\u51fb\u201c\u65b0\u5efa\u201d\uff0c\u8f93\u5165Python\u5b89\u88c5\u8def\u5f84\uff08\u5982<code>C:\\Python35<\/code>\uff09\u3002<\/li>\n<li>\u70b9\u51fb\u201c\u786e\u5b9a\u201d\u4fdd\u5b58\u3002<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u5b89\u88c5pip\u5de5\u5177<\/p>\n<\/p>\n<p><p>pip\u662fPython\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u901a\u5e38\u4f1a\u968fPython\u4e00\u8d77\u5b89\u88c5\u3002\u5982\u679c\u6ca1\u6709\u5b89\u88c5pip\uff0c\u53ef\u4ee5\u624b\u52a8\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d<code>get-pip.py<\/code>\u6587\u4ef6\u3002<\/li>\n<li>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\uff0c\u8fd0\u884c<code>python get-pip.py<\/code>\u3002<\/li>\n<\/ol>\n<p><p>\u5b8c\u6210\u540e\uff0c\u8f93\u5165<code>pip --version<\/code>\u9a8c\u8bc1\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u6d4b\u8bd5\u5b89\u88c5<\/p>\n<\/p>\n<p><p>\u6700\u540e\uff0c\u6d4b\u8bd5Python\u662f\u5426\u5b89\u88c5\u6210\u529f\u5e76\u80fd\u6b63\u5e38\u5de5\u4f5c\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Hello World\u6d4b\u8bd5<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08Windows\uff09\u6216\u7ec8\u7aef\uff08macOS\/Linux\uff09\u3002<\/li>\n<li>\u8f93\u5165<code>python<\/code>\uff08\u6216<code>python3<\/code>\uff09\uff0c\u8fdb\u5165Python\u4ea4\u4e92\u6a21\u5f0f\u3002<\/li>\n<li>\u8f93\u5165<code>print(&quot;Hello, World!&quot;)<\/code>\uff0c\u5982\u679c\u8f93\u51fa<code>Hello, World!<\/code>\uff0c\u5219\u8868\u793a\u5b89\u88c5\u6210\u529f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u7b80\u5355\u811a\u672c<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u521b\u5efa\u4e00\u4e2a<code>.py<\/code>\u6587\u4ef6\uff0c\u5982<code>test.py<\/code>\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a\n<pre><code class=\"language-python\">def m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n():<\/p>\n<p>    print(&quot;Python 3.5.4 is installed successfully.&quot;)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\/\u7ec8\u7aef\u4e2d\u8fd0\u884c\uff1a<code>python test.py<\/code>\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u4e03\u3001\u89e3\u51b3\u5e38\u89c1\u95ee\u9898<\/p>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7f3a\u5c11\u4f9d\u8d56<\/strong>\uff1a\u5c24\u5176\u662f\u5728Linux\u4e0a\uff0c\u53ef\u80fd\u7f3a\u5c11\u4e00\u4e9b\u5f00\u53d1\u5de5\u5177\u548c\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528\u5305\u7ba1\u7406\u5668\uff08\u5982apt\u3001yum\uff09\u5b89\u88c5\u6240\u9700\u4f9d\u8d56\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6743\u9650\u95ee\u9898<\/strong>\uff1a\u5728macOS\u548cLinux\u4e0a\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>sudo<\/code>\u8fdb\u884c\u6743\u9650\u63d0\u5347\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7248\u672c\u51b2\u7a81<\/strong>\uff1a\u5982\u679c\u7cfb\u7edf\u4e2d\u5b58\u5728\u591a\u4e2aPython\u7248\u672c\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>python3.5<\/code>\u660e\u786e\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u5b89\u88c5Python 3.5.4\u7684\u8fc7\u7a0b\u867d\u7136\u6bd4\u8f83\u7b80\u5355\uff0c\u4f46\u4ecd\u9700\u6ce8\u610f\u7ec6\u8282\u3002\u6309\u7167\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u5c06\u80fd\u591f\u6210\u529f\u5b89\u88c5\u5e76\u4f7f\u7528Python 3.5.4\u3002\u786e\u4fdd\u5728\u6bcf\u4e00\u6b65\u90fd\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4ee5\u907f\u514d\u53ef\u80fd\u7684\u9519\u8bef\u548c\u95ee\u9898\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u68c0\u67e5\u6211\u7684\u7cfb\u7edf\u662f\u5426\u652f\u6301Python 3.5.4\uff1f<\/strong><br \/>\u5728\u5b89\u88c5Python 3.5.4\u4e4b\u524d\uff0c\u786e\u4fdd\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\u6ee1\u8db3\u5b89\u88c5\u8981\u6c42\u3002\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u67e5\u770b\u5173\u4e8e\u7cfb\u7edf\u9700\u6c42\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u901a\u5e38\uff0cWindows\u3001macOS\u548c\u67d0\u4e9bLinux\u53d1\u884c\u7248\u90fd\u652f\u6301Python\uff0c\u4f46\u4f60\u9700\u8981\u786e\u8ba4\u4f60\u7684\u7cfb\u7edf\u7248\u672c\u4e0ePython 3.5.4\u7684\u517c\u5bb9\u6027\u3002\u68c0\u67e5\u7cfb\u7edf\u7248\u672c\u7684\u65b9\u6cd5\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165 <code>python --version<\/code> \u6216 <code>python3 --version<\/code> \u6765\u786e\u8ba4\u5f53\u524d\u5b89\u88c5\u7684Python\u7248\u672c\u3002<\/p>\n<p><strong>\u6211\u9700\u8981\u5b89\u88c5\u54ea\u4e9b\u4f9d\u8d56\u9879\u624d\u80fd\u987a\u5229\u5b89\u88c5Python 3.5.4\uff1f<\/strong><br \/>\u5728\u67d0\u4e9b\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u5b89\u88c5Python\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u989d\u5916\u7684\u4f9d\u8d56\u9879\u3002\u4f8b\u5982\uff0c\u5728Ubuntu\u4e0a\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5f00\u53d1\u5de5\u5177\u548c\u5e93\u3002\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u53ef\u4ee5\u786e\u4fdd\u4f60\u62e5\u6709\u5fc5\u8981\u7684\u6784\u5efa\u5de5\u5177\uff1a  <\/p>\n<pre><code class=\"language-bash\">sudo apt-get update\nsudo apt-get install build-essential libssl-dev libffi-dev python3-dev\n<\/code><\/pre>\n<p>\u786e\u4fdd\u5728\u5b89\u88c5\u4e4b\u524d\uff0c\u5df2\u7ecf\u5b89\u88c5\u4e86\u8fd9\u4e9b\u4f9d\u8d56\u9879\uff0c\u4ee5\u9632\u51fa\u73b0\u9519\u8bef\u3002<\/p>\n<p><strong>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5982\u4f55\u9a8c\u8bc1Python 3.5.4\u662f\u5426\u6210\u529f\u5b89\u88c5\uff1f<\/strong><br \/>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u8f93\u5165 <code>python3.5 --version<\/code> \u6765\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002\u5982\u679c\u5b89\u88c5\u6210\u529f\uff0c\u4f60\u5c06\u770b\u5230Python 3.5.4\u7684\u7248\u672c\u53f7\u663e\u793a\u5728\u5c4f\u5e55\u4e0a\u3002\u6b64\u5916\uff0c\u4f60\u8fd8\u53ef\u4ee5\u8fd0\u884c <code>python3.5<\/code> \u8fdb\u5165Python\u89e3\u91ca\u5668\uff0c\u786e\u8ba4\u5176\u80fd\u591f\u6b63\u5e38\u542f\u52a8\u5e76\u6267\u884c\u57fa\u672c\u7684Python\u547d\u4ee4\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5b89\u88c5Python 3.5.4\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u60a8\u7684\u7cfb\u7edf\u6ee1\u8db3\u5b89\u88c5\u8981\u6c42\u3001\u4e0b\u8f7d\u6b63\u786e\u7684\u5b89\u88c5\u5305\u3001\u6b63\u786e\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u5e76\u8fdb\u884c\u6d4b [&hellip;]","protected":false},"author":3,"featured_media":1013434,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1013423"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1013423"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1013423\/revisions"}],"predecessor-version":[{"id":1013436,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1013423\/revisions\/1013436"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1013434"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1013423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1013423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1013423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}