{"id":959053,"date":"2024-12-27T03:37:21","date_gmt":"2024-12-26T19:37:21","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/959053.html"},"modified":"2024-12-27T03:37:23","modified_gmt":"2024-12-26T19:37:23","slug":"%e5%a6%82%e4%bd%95%e7%9c%8b%e7%94%b5%e8%84%91python%e7%89%88%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/959053.html","title":{"rendered":"\u5982\u4f55\u770b\u7535\u8111python\u7248\u672c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25101958\/617a7c30-5feb-4438-a077-6b85ea3bfc50.webp\" alt=\"\u5982\u4f55\u770b\u7535\u8111python\u7248\u672c\" \/><\/p>\n<p><p> <strong>\u8981\u67e5\u770b\u7535\u8111\u4e0a\u7684Python\u7248\u672c\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u3001Python\u811a\u672c\u6216\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3002\u5176\u4e2d\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u547d\u4ee4\u884c\u67e5\u770b\uff0c\u901a\u8fc7\u547d\u4ee4\u884c\u67e5\u770bPython\u7248\u672c\u7684\u6b65\u9aa4\u7b80\u5355\u3001\u76f4\u63a5\u3001\u9002\u7528\u8303\u56f4\u5e7f\u3002<\/strong>\u5177\u4f53\u64cd\u4f5c\u6b65\u9aa4\u5982\u4e0b\uff1a\u6253\u5f00\u547d\u4ee4\u884c\u754c\u9762\uff0c\u8f93\u5165<code>python --version<\/code>\u6216<code>python -V<\/code>\uff0c\u7136\u540e\u6309Enter\u952e\u3002\u8fd9\u5c06\u663e\u793aPython\u7684\u7248\u672c\u53f7\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5404\u79cd\u65b9\u6cd5\u6765\u67e5\u770bPython\u7248\u672c\uff0c\u4ee5\u53ca\u5982\u4f55\u89e3\u51b3\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u901a\u8fc7\u547d\u4ee4\u884c\u67e5\u770bPython\u7248\u672c<\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u547d\u4ee4\u884c\u67e5\u770bPython\u7248\u672c\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u4e4b\u4e00\uff0c\u56e0\u4e3a\u5b83\u5feb\u901f\u4e14\u7b80\u5355\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Windows\u7cfb\u7edf<\/strong><\/p>\n<\/p>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u67e5\u770bPython\u7248\u672c\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u3002\u53ef\u4ee5\u901a\u8fc7\u5728\u201c\u5f00\u59cb\u201d\u83dc\u5355\u4e2d\u641c\u7d22\u201ccmd\u201d\u6765\u627e\u5230\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -V<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u6309Enter\u952e\uff0c\u8fd9\u5c06\u663e\u793a\u5b89\u88c5\u7684Python\u7248\u672c\u53f7\uff0c\u4f8b\u5982\uff1a<code>Python 3.8.5<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u5982\u679c\u547d\u4ee4\u63d0\u793a\u7b26\u65e0\u6cd5\u8bc6\u522b\u201cpython\u201d\u547d\u4ee4\uff0c\u53ef\u80fd\u662fPython\u672a\u6b63\u786e\u5b89\u88c5\u6216\u73af\u5883\u53d8\u91cf\u672a\u914d\u7f6e\u3002\u53ef\u4ee5\u68c0\u67e5Python\u662f\u5426\u5df2\u5b89\u88c5\uff0c\u6216\u8005\u91cd\u65b0\u5b89\u88c5Python\u5e76\u786e\u4fdd\u5728\u5b89\u88c5\u65f6\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>Mac\u548cLinux\u7cfb\u7edf<\/strong><\/p>\n<\/p>\n<p><p>\u5728Mac\u548cLinux\u7cfb\u7edf\u4e2d\uff0c\u67e5\u770bPython\u7248\u672c\u7684\u6b65\u9aa4\u7c7b\u4f3c\u4e8eWindows\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u6253\u5f00\u7ec8\u7aef\u3002Mac\u7528\u6237\u53ef\u4ee5\u5728\u201c\u5e94\u7528\u7a0b\u5e8f\u201d -&gt; \u201c\u5b9e\u7528\u5de5\u5177\u201d\u4e2d\u627e\u5230\u7ec8\u7aef\uff0cLinux\u7528\u6237\u901a\u5e38\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u4e2d\u627e\u5230\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 -V<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u6309Enter\u952e\uff0c\u8fd9\u5c06\u663e\u793a\u5b89\u88c5\u7684Python\u7248\u672c\u53f7\uff0c\u4f8b\u5982\uff1a<code>Python 3.8.5<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u5728\u5927\u591a\u6570\u73b0\u4ee3Linux\u53d1\u884c\u7248\u548cMac\u7cfb\u7edf\u4e2d\uff0cPython 2\u548cPython 3\u53ef\u80fd\u540c\u65f6\u5b89\u88c5\uff0c\u56e0\u6b64\u5efa\u8bae\u4f7f\u7528<code>python3<\/code>\u547d\u4ee4\u6765\u786e\u4fdd\u67e5\u770b\u7684\u662fPython 3\u7684\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u901a\u8fc7Python\u811a\u672c\u67e5\u770b\u7248\u672c<\/p>\n<\/p>\n<p><p>\u5982\u679c\u60a8\u4e60\u60ef\u4e8e\u4f7f\u7528Python\u811a\u672c\uff0c\u53ef\u4ee5\u901a\u8fc7Python\u4ee3\u7801\u67e5\u770b\u7248\u672c\u4fe1\u606f\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\uff0c\u4f8b\u5982<code>check_version.py<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u5728\u6587\u4ef6\u4e2d\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sys<\/p>\n<p>print(&quot;Python version&quot;)<\/p>\n<p>print(sys.version)<\/p>\n<p>print(&quot;Version info.&quot;)<\/p>\n<p>print(sys.version_info)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u4fdd\u5b58\u6587\u4ef6\u5e76\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\u8fd0\u884c\u8be5\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python check_version.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 check_version.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u8f93\u51faPython\u7684\u7248\u672c\u53f7\u548c\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u901a\u8fc7\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u67e5\u770b\u7248\u672c<\/p>\n<\/p>\n<p><p>\u8bb8\u591aPython\u5f00\u53d1\u8005\u4f7f\u7528IDE\u6765\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801\uff0cIDE\u901a\u5e38\u4f1a\u663e\u793a\u5f53\u524d\u4f7f\u7528\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>PyCharm<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00PyCharm\u5e76\u521b\u5efa\u6216\u6253\u5f00\u4e00\u4e2a\u9879\u76ee\u3002<\/li>\n<li>\u5728\u9879\u76ee\u7ed3\u6784\u89c6\u56fe\u4e2d\uff0c\u53f3\u4e0b\u89d2\u901a\u5e38\u4f1a\u663e\u793a\u5f53\u524d\u7684Python\u89e3\u91ca\u5668\u548c\u7248\u672c\u53f7\u3002<\/li>\n<li>\u5982\u679c\u9700\u8981\u66f4\u6539Python\u7248\u672c\uff0c\u53ef\u4ee5\u901a\u8fc7\u201cFile\u201d -&gt; \u201cSettings\u201d -&gt; \u201cProject: [YourProjectName]\u201d -&gt; \u201cPython Interpreter\u201d\u6765\u9009\u62e9\u4e0d\u540c\u7684Python\u7248\u672c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Visual Studio Code<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00Visual Studio Code\u5e76\u521b\u5efa\u6216\u6253\u5f00\u4e00\u4e2aPython\u6587\u4ef6\u3002<\/li>\n<li>\u5728\u5e95\u90e8\u72b6\u6001\u680f\u4e2d\uff0c\u901a\u5e38\u4f1a\u663e\u793a\u5f53\u524d\u9009\u62e9\u7684Python\u7248\u672c\u3002<\/li>\n<li>\u5982\u679c\u9700\u8981\u5207\u6362Python\u7248\u672c\uff0c\u53ef\u4ee5\u70b9\u51fb\u72b6\u6001\u680f\u4e2d\u7684Python\u7248\u672c\u53f7\uff0c\u7136\u540e\u4ece\u4e0b\u62c9\u83dc\u5355\u4e2d\u9009\u62e9\u5176\u4ed6\u5df2\u5b89\u88c5\u7684Python\u7248\u672c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Jupyter Notebook<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p>\u6253\u5f00Jupyter Notebook\u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7b14\u8bb0\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u5728\u4e00\u4e2a\u65b0\u7684\u5355\u5143\u683c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\u5e76\u8fd0\u884c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sys<\/p>\n<p>print(sys.version)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u8fd9\u5c06\u8f93\u51fa\u5f53\u524d\u4f7f\u7528\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u786e\u4fdd\u591a\u4e2aPython\u7248\u672c\u4e4b\u95f4\u7684\u517c\u5bb9\u6027<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u5f00\u53d1\u8005\u53ef\u80fd\u5728\u540c\u4e00\u53f0\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5\u4e86\u591a\u4e2aPython\u7248\u672c\u3002\u4e3a\u4e86\u786e\u4fdd\u9879\u76ee\u7684\u517c\u5bb9\u6027\u548c\u6b63\u786e\u6027\uff0c\u7ba1\u7406\u548c\u5207\u6362\u4e0d\u540c\u7684Python\u7248\u672c\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528\u865a\u62df\u73af\u5883<\/strong><\/p>\n<\/p>\n<p><p>\u865a\u62df\u73af\u5883\u5141\u8bb8\u5f00\u53d1\u8005\u4e3a\u6bcf\u4e2a\u9879\u76ee\u521b\u5efa\u4e00\u4e2a\u72ec\u7acb\u7684Python\u73af\u5883\uff0c\u786e\u4fdd\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u7684\u4f9d\u8d56\u5173\u7cfb\u4e0d\u4f1a\u51b2\u7a81\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -m venv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 -m venv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u5728Windows\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">myenv\\Scripts\\activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5728Mac\u548cLinux\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">source myenv\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6fc0\u6d3b\u540e\uff0c\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5Python\u5305\u5c06\u4e0d\u4f1a\u5f71\u54cd\u5168\u5c40Python\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528pyenv\u7ba1\u7406Python\u7248\u672c<\/strong><\/p>\n<\/p>\n<p><p><code>pyenv<\/code>\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5de5\u5177\uff0c\u7528\u4e8e\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\u3002\u5b83\u5141\u8bb8\u7528\u6237\u5728\u7cfb\u7edf\u4e2d\u5b89\u88c5\u3001\u5378\u8f7d\u548c\u5207\u6362\u4e0d\u540c\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u5b89\u88c5<code>pyenv<\/code>\uff08\u5728Linux\u548cMac\u7cfb\u7edf\u4e2d\uff09\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">curl https:\/\/pyenv.run | bash<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5b89\u88c5Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyenv install 3.8.5<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5207\u6362Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyenv global 3.8.5<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7<code>pyenv<\/code>\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u8f7b\u677e\u5730\u5728\u4e0d\u540c\u9879\u76ee\u4e2d\u4f7f\u7528\u4e0d\u540c\u7684Python\u7248\u672c\uff0c\u786e\u4fdd\u9879\u76ee\u7684\u517c\u5bb9\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6848<\/p>\n<\/p>\n<p><p>\u5728\u67e5\u770b\u548c\u7ba1\u7406Python\u7248\u672c\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u53ef\u80fd\u7684\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Python\u547d\u4ee4\u65e0\u6cd5\u8bc6\u522b<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u547d\u4ee4\u884c\u663e\u793a\u201cpython\u201d\u547d\u4ee4\u65e0\u6cd5\u8bc6\u522b\uff0c\u53ef\u80fd\u662f\u56e0\u4e3aPython\u672a\u6b63\u786e\u5b89\u88c5\u6216\u73af\u5883\u53d8\u91cf\u672a\u914d\u7f6e\u3002\u53ef\u4ee5\u5c1d\u8bd5\u91cd\u65b0\u5b89\u88c5Python\uff0c\u5e76\u5728\u5b89\u88c5\u65f6\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u591a\u4e2aPython\u7248\u672c\u51b2\u7a81<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u7cfb\u7edf\u4e2d\u5b89\u88c5\u4e86\u591a\u4e2aPython\u7248\u672c\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u547d\u4ee4\u884c\u4f7f\u7528\u7684\u7248\u672c\u4e0e\u671f\u671b\u7684\u4e0d\u4e00\u81f4\u3002\u53ef\u4ee5\u4f7f\u7528<code>pyenv<\/code>\u6216\u865a\u62df\u73af\u5883\u6765\u7ba1\u7406\u548c\u5207\u6362Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>IDE\u65e0\u6cd5\u68c0\u6d4bPython\u7248\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679cIDE\u65e0\u6cd5\u68c0\u6d4b\u5230Python\u7248\u672c\uff0c\u53ef\u80fd\u9700\u8981\u5728IDE\u8bbe\u7f6e\u4e2d\u624b\u52a8\u6307\u5b9aPython\u89e3\u91ca\u5668\u8def\u5f84\u3002\u8bf7\u67e5\u9605IDE\u7684\u5b98\u65b9\u6587\u6863\u4ee5\u83b7\u53d6\u8be6\u7ec6\u8bf4\u660e\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u67e5\u770b\u548c\u7ba1\u7406\u8ba1\u7b97\u673a\u4e0a\u7684Python\u7248\u672c\uff0c\u786e\u4fdd\u5f00\u53d1\u73af\u5883\u7684\u7a33\u5b9a\u548c\u517c\u5bb9\u6027\u3002\u65e0\u8bba\u662f\u5728\u547d\u4ee4\u884c\u3001\u811a\u672c\u8fd8\u662fIDE\u4e2d\uff0c\u4e86\u89e3\u5982\u4f55\u67e5\u770bPython\u7248\u672c\u90fd\u662f\u6bcf\u4e2aPython\u5f00\u53d1\u8005\u7684\u57fa\u672c\u6280\u80fd\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u786e\u8ba4\u6211\u5b89\u88c5\u7684Python\u7248\u672c\uff1f<\/strong><br \/>\u8981\u67e5\u770b\u7535\u8111\u4e0a\u5b89\u88c5\u7684Python\u7248\u672c\uff0c\u53ef\u4ee5\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08Windows\uff09\u6216\u7ec8\u7aef\uff08Mac\/Linux\uff09\uff0c\u8f93\u5165\u547d\u4ee4<code>python --version<\/code>\u6216<code>python3 --version<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u3002\u7cfb\u7edf\u4f1a\u663e\u793a\u5f53\u524d\u5b89\u88c5\u7684Python\u7248\u672c\u53f7\u3002<\/p>\n<p><strong>\u5728\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u67e5\u770bPython\u7248\u672c\u7684\u65b9\u6cd5\u6709\u4f55\u4e0d\u540c\uff1f<\/strong><br \/>\u5728Windows\u4e0a\uff0c\u901a\u5e38\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\uff1b\u800c\u5728Mac\u6216Linux\u4e2d\uff0c\u4f7f\u7528\u7ec8\u7aef\u3002\u65e0\u8bba\u5728\u54ea\u79cd\u7cfb\u7edf\u4e2d\uff0c\u547d\u4ee4\u683c\u5f0f\u57fa\u672c\u76f8\u540c\uff0c\u53ef\u4ee5\u4f7f\u7528<code>python<\/code>\u6216<code>python3<\/code>\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u4f60\u7684\u5b89\u88c5\u60c5\u51b5\u3002\u5982\u679c\u4f60\u6709\u591a\u4e2a\u7248\u672c\u7684Python\uff0c\u786e\u4fdd\u4f7f\u7528\u6b63\u786e\u7684\u547d\u4ee4\u3002<\/p>\n<p><strong>\u5982\u679c\u6211\u53d1\u73b0\u6211\u7684Python\u7248\u672c\u8fc7\u65e7\uff0c\u5e94\u8be5\u5982\u4f55\u66f4\u65b0\uff1f<\/strong><br \/>\u66f4\u65b0Python\u7684\u6b65\u9aa4\u56e0\u64cd\u4f5c\u7cfb\u7edf\u800c\u5f02\u3002\u5728Windows\u4e0a\uff0c\u53ef\u4ee5\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684\u5b89\u88c5\u7a0b\u5e8f\u5e76\u8fdb\u884c\u5b89\u88c5\u3002\u5728Mac\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7Homebrew\u4f7f\u7528\u547d\u4ee4<code>brew upgrade python<\/code>\u8fdb\u884c\u66f4\u65b0\u3002\u800c\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u5305\u7ba1\u7406\u5668\uff08\u5982apt\u6216yum\uff09\u6765\u66f4\u65b0Python\uff0c\u5177\u4f53\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u5404\u81ea\u7684\u6587\u6863\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u73af\u5883\u4e2d\u68c0\u67e5\u7248\u672c\uff1f<\/strong><br \/>\u5728Python\u4ea4\u4e92\u5f0f\u73af\u5883\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\u6765\u67e5\u770b\u7248\u672c\uff1a  <\/p>\n<pre><code class=\"language-python\">import sys  \nprint(sys.version)\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u4e0d\u4ec5\u4f1a\u663e\u793a\u7248\u672c\u53f7\uff0c\u8fd8\u4f1a\u63d0\u4f9b\u6709\u5173\u6784\u5efa\u4fe1\u606f\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u9002\u5408\u9700\u8981\u8fdb\u4e00\u6b65\u4e86\u89e3\u73af\u5883\u8bbe\u7f6e\u7684\u5f00\u53d1\u8005\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u67e5\u770b\u7535\u8111\u4e0a\u7684Python\u7248\u672c\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u3001Python\u811a\u672c\u6216\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3002\u5176\u4e2d\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u901a [&hellip;]","protected":false},"author":3,"featured_media":959060,"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\/959053"}],"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=959053"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/959053\/revisions"}],"predecessor-version":[{"id":959062,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/959053\/revisions\/959062"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/959060"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=959053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=959053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=959053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}