{"id":980134,"date":"2024-12-27T06:52:06","date_gmt":"2024-12-26T22:52:06","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/980134.html"},"modified":"2024-12-27T06:52:08","modified_gmt":"2024-12-26T22:52:08","slug":"%e5%a6%82%e4%bd%95%e5%8d%b8%e8%bd%bdpython%e5%85%b6%e4%bb%96%e7%89%88%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/980134.html","title":{"rendered":"\u5982\u4f55\u5378\u8f7dpython\u5176\u4ed6\u7248\u672c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24205645\/3df8f997-d7c8-4c8b-aae9-05dedf068110.webp\" alt=\"\u5982\u4f55\u5378\u8f7dpython\u5176\u4ed6\u7248\u672c\" \/><\/p>\n<p><p> <strong>\u8981\u5378\u8f7dPython\u7684\u5176\u4ed6\u7248\u672c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a\u4f7f\u7528\u7cfb\u7edf\u7684\u5305\u7ba1\u7406\u5de5\u5177\u3001\u901a\u8fc7\u5b89\u88c5\u76ee\u5f55\u624b\u52a8\u5220\u9664\u3001\u4f7f\u7528Python\u81ea\u5e26\u7684\u5378\u8f7d\u5de5\u5177\u3002\u6211\u4eec\u5c06\u8be6\u7ec6\u63a2\u8ba8\u901a\u8fc7\u7cfb\u7edf\u7684\u5305\u7ba1\u7406\u5de5\u5177\u6765\u5378\u8f7dPython\u7248\u672c\uff0c\u56e0\u4e3a\u8fd9\u901a\u5e38\u662f\u6700\u5b89\u5168\u548c\u6700\u7b80\u4fbf\u7684\u65b9\u6cd5\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u5927\u591a\u6570\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u5305\u7ba1\u7406\u5de5\u5177\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u7ba1\u7406\u548c\u5378\u8f7d\u8f6f\u4ef6\u5305\u3002\u4ee5Windows\u4e3a\u4f8b\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u201c\u6dfb\u52a0\u6216\u5220\u9664\u7a0b\u5e8f\u201d\u6765\u5378\u8f7dPython\u7248\u672c\u3002\u5728MacOS\u548cLinux\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u5982<code>brew<\/code>\u6216<code>apt-get<\/code>\uff0c\u6765\u5378\u8f7dPython\u7248\u672c\u3002\u901a\u8fc7\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u60a8\u53ef\u4ee5\u786e\u4fdd\u76f8\u5173\u7684\u73af\u5883\u53d8\u91cf\u548c\u4f9d\u8d56\u9879\u4e5f\u88ab\u6b63\u786e\u5904\u7406\uff0c\u51cf\u5c11\u6f5c\u5728\u7684\u7cfb\u7edf\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001WINDOWS\u7cfb\u7edf\u4e2d\u7684\u5378\u8f7d\u65b9\u6cd5<\/p>\n<\/p>\n<p><p>Windows\u662f\u76ee\u524d\u5168\u7403\u4f7f\u7528\u6700\u5e7f\u6cdb\u7684\u684c\u9762\u64cd\u4f5c\u7cfb\u7edf\u4e4b\u4e00\u3002\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u5378\u8f7dPython\u7248\u672c\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u201c\u6dfb\u52a0\u6216\u5220\u9664\u7a0b\u5e8f\u201d\u6765\u5b9e\u73b0\u3002\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u76f4\u89c2\u548c\u7528\u6237\u53cb\u597d\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528\u201c\u6dfb\u52a0\u6216\u5220\u9664\u7a0b\u5e8f\u201d<\/strong><\/p>\n<\/p>\n<p><p> \u9996\u5148\uff0c\u6253\u5f00\u63a7\u5236\u9762\u677f\uff0c\u8fdb\u5165\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\u9009\u9879\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u53ef\u4ee5\u770b\u5230\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5\u7684\u6240\u6709\u8f6f\u4ef6\u5217\u8868\u3002\u901a\u8fc7\u641c\u7d22\u201cPython\u201d\uff0c\u60a8\u53ef\u4ee5\u627e\u5230\u6240\u6709\u5b89\u88c5\u7684Python\u7248\u672c\u3002\u9009\u62e9\u60a8\u8981\u5378\u8f7d\u7684\u7248\u672c\uff0c\u5355\u51fb\u201c\u5378\u8f7d\u201d\u6309\u94ae\u5373\u53ef\u3002\u8fd9\u79cd\u65b9\u6cd5\u786e\u4fdd\u4e86\u7cfb\u7edf\u4f1a\u6e05\u7406\u4e0e\u8be5Python\u7248\u672c\u76f8\u5173\u7684\u6240\u6709\u6ce8\u518c\u8868\u9879\u548c\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u547d\u4ee4\u884c<\/strong><\/p>\n<\/p>\n<p><p> \u9664\u4e86\u56fe\u5f62\u754c\u9762\uff0c\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u6765\u5378\u8f7dPython\u3002\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u53ef\u4ee5\u5217\u51fa\u6240\u6709\u5b89\u88c5\u7684\u7a0b\u5e8f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">wmic product get name<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p> \u627e\u5230\u60a8\u8981\u5378\u8f7d\u7684Python\u7248\u672c\uff0c\u7136\u540e\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5378\u8f7d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">wmic product where &quot;name like &#39;Python 3.x.x&#39;&quot; call uninstall<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p> \u5c06<code>3.x.x<\/code>\u66ff\u6362\u4e3a\u60a8\u8981\u5378\u8f7d\u7684\u5177\u4f53\u7248\u672c\u53f7\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001MACOS\u7cfb\u7edf\u4e2d\u7684\u5378\u8f7d\u65b9\u6cd5<\/p>\n<\/p>\n<p><p>MacOS\u7cfb\u7edf\u7528\u6237\u901a\u5e38\u4f7f\u7528Homebrew\u8fd9\u6837\u7684\u5305\u7ba1\u7406\u5de5\u5177\u6765\u7ba1\u7406\u8f6f\u4ef6\u5305\u3002\u5728MacOS\u4e2d\uff0c\u60a8\u4e5f\u53ef\u4ee5\u901a\u8fc7\u624b\u52a8\u5220\u9664\u76f8\u5173\u76ee\u5f55\u6765\u5378\u8f7dPython\u7248\u672c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528Homebrew\u5378\u8f7d<\/strong><\/p>\n<\/p>\n<p><p> \u5982\u679c\u60a8\u662f\u901a\u8fc7Homebrew\u5b89\u88c5\u7684Python\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5378\u8f7d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">brew uninstall python@3.x<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p> \u8fd9\u5c06\u5378\u8f7d\u6307\u5b9a\u7684Python\u7248\u672c\uff0c\u5e76\u6e05\u7406\u76f8\u5173\u6587\u4ef6\u3002Homebrew\u7684\u4f18\u52bf\u5728\u4e8e\uff0c\u5b83\u4f1a\u81ea\u52a8\u5904\u7406\u6240\u6709\u76f8\u5173\u7684\u4f9d\u8d56\u9879\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u624b\u52a8\u5220\u9664<\/strong><\/p>\n<\/p>\n<p><p> \u624b\u52a8\u5220\u9664\u6d89\u53ca\u5220\u9664Python\u5b89\u88c5\u76ee\u5f55\u548c\u76f8\u5173\u7684\u73af\u5883\u53d8\u91cf\u3002\u901a\u5e38\uff0cPython\u5b89\u88c5\u5728<code>\/Library\/Frameworks\/Python.framework\/Versions\/<\/code>\u76ee\u5f55\u4e2d\u3002\u60a8\u9700\u8981\u5220\u9664\u5bf9\u5e94\u7684\u7248\u672c\u76ee\u5f55\u3002\u6b64\u5916\uff0c\u8fd8\u9700\u8981\u4ece<code>\/usr\/local\/bin<\/code>\u4e2d\u5220\u9664\u76f8\u5173\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001LINUX\u7cfb\u7edf\u4e2d\u7684\u5378\u8f7d\u65b9\u6cd5<\/p>\n<\/p>\n<p><p>Linux\u7cfb\u7edf\u4e0a\uff0cPython\u901a\u5e38\u662f\u901a\u8fc7\u5305\u7ba1\u7406\u5de5\u5177\uff08\u5982apt\u3001yum\u7b49\uff09\u6765\u5b89\u88c5\u548c\u7ba1\u7406\u7684\u3002\u4e0d\u540c\u7684Linux\u53d1\u884c\u7248\u53ef\u80fd\u4f7f\u7528\u4e0d\u540c\u7684\u5305\u7ba1\u7406\u5de5\u5177\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528APT\u5378\u8f7d\uff08Ubuntu\/Debian\uff09<\/strong><\/p>\n<\/p>\n<p><p> \u5728Ubuntu\u6216Debian\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5378\u8f7dPython\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">sudo apt-get remove python3.x<\/p>\n<p>sudo apt-get autoremove<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p> \u8fd9\u4e9b\u547d\u4ee4\u5c06\u5378\u8f7d\u6307\u5b9a\u7684Python\u7248\u672c\uff0c\u5e76\u81ea\u52a8\u5220\u9664\u4e0d\u518d\u9700\u8981\u7684\u5305\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528YUM\u5378\u8f7d\uff08CentOS\/RedHat\uff09<\/strong><\/p>\n<\/p>\n<p><p> \u5728CentOS\u6216RedHat\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5378\u8f7dPython\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">sudo yum remove python3.x<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p> \u8fd9\u5c06\u5378\u8f7d\u6307\u5b9a\u7684Python\u7248\u672c\uff0c\u5e76\u6e05\u7406\u76f8\u5173\u7684\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u5904\u7406\u5378\u8f7d\u540e\u7684\u9057\u7559\u95ee\u9898<\/p>\n<\/p>\n<p><p>\u65e0\u8bba\u60a8\u4f7f\u7528\u54ea\u79cd\u65b9\u6cd5\u5378\u8f7dPython\uff0c\u53ef\u80fd\u90fd\u4f1a\u7559\u4e0b\u73af\u5883\u53d8\u91cf\u3001\u914d\u7f6e\u6587\u4ef6\u7b49\u9057\u7559\u95ee\u9898\u3002\u8fd9\u4e9b\u95ee\u9898\u5982\u679c\u4e0d\u5904\u7406\uff0c\u53ef\u80fd\u4f1a\u5f71\u54cd\u7cfb\u7edf\u7684\u6b63\u5e38\u8fd0\u884c\uff0c\u6216\u8005\u5f71\u54cd\u5176\u4ed6Python\u7248\u672c\u7684\u4f7f\u7528\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6e05\u7406\u73af\u5883\u53d8\u91cf<\/strong><\/p>\n<\/p>\n<p><p> \u5728\u5378\u8f7dPython\u540e\uff0c\u60a8\u9700\u8981\u68c0\u67e5\u5e76\u6e05\u7406\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\uff0c\u786e\u4fddPATH\u4e2d\u6ca1\u6709\u6307\u5411\u5df2\u7ecf\u5378\u8f7d\u7684Python\u7248\u672c\u7684\u8def\u5f84\u3002\u5728Windows\u4e0a\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u7cfb\u7edf\u5c5e\u6027\u4e2d\u7684\u201c\u73af\u5883\u53d8\u91cf\u201d\u8fdb\u884c\u8bbe\u7f6e\uff1b\u5728MacOS\u548cLinux\u4e0a\uff0c\u60a8\u53ef\u4ee5\u4fee\u6539<code>~\/.bash_profile<\/code>\u6216<code>~\/.bashrc<\/code>\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5220\u9664\u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p> \u5378\u8f7dPython\u540e\uff0c\u6709\u4e9b\u914d\u7f6e\u6587\u4ef6\u53ef\u80fd\u4f1a\u7559\u5728\u7cfb\u7edf\u4e2d\u3002\u67e5\u627e\u5e76\u5220\u9664\u53ef\u80fd\u7559\u5b58\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5982<code>~\/.python_history<\/code>\u3001<code>~\/.local\/lib\/python3.x<\/code>\u7b49\uff0c\u786e\u4fdd\u5378\u8f7d\u5f7b\u5e95\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6e05\u7406\u4f9d\u8d56\u5e93<\/strong><\/p>\n<\/p>\n<p><p> \u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0cPython\u7684\u7b2c\u4e09\u65b9\u5e93\u53ef\u80fd\u4f1a\u7559\u5b58\u5728\u7cfb\u7edf\u4e2d\u3002\u53ef\u4ee5\u901a\u8fc7Python\u7684\u5305\u7ba1\u7406\u5de5\u5177<code>pip<\/code>\u6765\u67e5\u770b\u548c\u6e05\u7406\u8fd9\u4e9b\u5e93\u3002\u5728\u5378\u8f7dPython\u7248\u672c\u524d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5217\u51fa\u5b89\u88c5\u7684\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pip freeze &gt; installed_packages.txt<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p> \u5378\u8f7d\u540e\uff0c\u60a8\u53ef\u4ee5\u624b\u52a8\u5220\u9664\u8fd9\u4e9b\u5e93\u6240\u5728\u7684\u76ee\u5f55\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u91cd\u65b0\u5b89\u88c5\u4e0e\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u540c\u65f6\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\uff0c\u4ee5\u4fbf\u5728\u4e0d\u540c\u7684\u9879\u76ee\u4e2d\u4f7f\u7528\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u5de5\u5177\u6765\u5e2e\u52a9\u60a8\u7ba1\u7406\u548c\u5207\u6362\u4e0d\u540c\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528Pyenv<\/strong><\/p>\n<\/p>\n<p><p> Pyenv\u662f\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684Python\u7248\u672c\u7ba1\u7406\u5de5\u5177\u3002\u5b83\u5141\u8bb8\u60a8\u5728\u540c\u4e00\u7cfb\u7edf\u4e2d\u5b89\u88c5\u548c\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\u3002\u5b89\u88c5Pyenv\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u65b0\u7684Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pyenv install 3.x.x<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p> \u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5207\u6362Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pyenv global 3.x.x<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p> \u8fd9\u4f7f\u5f97\u5728\u4e0d\u540c\u9879\u76ee\u4e2d\u4f7f\u7528\u4e0d\u540c\u7684Python\u7248\u672c\u53d8\u5f97\u975e\u5e38\u7b80\u5355\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528Anaconda<\/strong><\/p>\n<\/p>\n<p><p> Anaconda\u662f\u4e00\u4e2a\u5f00\u6e90\u7684Python\u53d1\u884c\u7248\uff0c\u5305\u542b\u8bb8\u591a\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u636e\u79d1\u5b66\u76f8\u5173\u7684\u5e93\u3002Anaconda\u9644\u5e26\u4e86\u4e00\u4e2a\u73af\u5883\u7ba1\u7406\u5de5\u5177<code>conda<\/code>\uff0c\u5141\u8bb8\u60a8\u521b\u5efa\u548c\u7ba1\u7406\u865a\u62df\u73af\u5883\uff0c\u6bcf\u4e2a\u73af\u5883\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<p><p> \u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u73af\u5883\uff0c\u5e76\u6307\u5b9aPython\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">conda create --name myenv python=3.x<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p> \u6fc0\u6d3b\u73af\u5883\u540e\uff0c\u60a8\u53ef\u4ee5\u5728\u8be5\u73af\u5883\u4e2d\u5b89\u88c5\u6240\u9700\u7684\u5305\u548c\u5e93\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\u548c\u6280\u5de7\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u5378\u8f7d\u4e0d\u9700\u8981\u7684Python\u7248\u672c\uff0c\u5e76\u6709\u6548\u7ba1\u7406\u548c\u4f7f\u7528\u591a\u4e2aPython\u7248\u672c\uff0c\u4ee5\u6ee1\u8db3\u4e0d\u540c\u9879\u76ee\u7684\u9700\u6c42\u3002\u65e0\u8bba\u662f\u901a\u8fc7\u7cfb\u7edf\u7684\u5305\u7ba1\u7406\u5de5\u5177\u8fd8\u662f\u4f7f\u7528\u4e13\u4e1a\u7684\u7248\u672c\u7ba1\u7406\u5de5\u5177\uff0c\u4e86\u89e3\u5982\u4f55\u6b63\u786e\u5378\u8f7d\u548c\u7ba1\u7406Python\u7248\u672c\u662f\u6bcf\u4e2a\u5f00\u53d1\u8005\u7684\u91cd\u8981\u6280\u80fd\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5224\u65ad\u6211\u7535\u8111\u4e0a\u5b89\u88c5\u4e86\u54ea\u4e9b\u7248\u672c\u7684Python\uff1f<\/strong><br \/>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u5e76\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u6765\u67e5\u770b\u5f53\u524d\u6fc0\u6d3b\u7684Python\u7248\u672c\u3002\u6b64\u5916\uff0c\u8bbf\u95ee\u201c\u63a7\u5236\u9762\u677f\u201d\u4e2d\u7684\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\u4e5f\u80fd\u5217\u51fa\u6240\u6709\u5b89\u88c5\u7684Python\u7248\u672c\u3002\u5728Mac\u6216Linux\u7cfb\u7edf\u4e2d\uff0c\u4f7f\u7528<code>ls \/Library\/Frameworks\/Python.framework\/Versions\/<\/code>\u6216<code>ls \/usr\/bin\/python*<\/code>\u547d\u4ee4\u53ef\u67e5\u770b\u5df2\u5b89\u88c5\u7684\u7248\u672c\u3002<\/p>\n<p><strong>\u5378\u8f7dPython\u4f1a\u5f71\u54cd\u6211\u7684\u5176\u4ed6\u7a0b\u5e8f\u5417\uff1f<\/strong><br \/>\u5378\u8f7dPython\u53ef\u80fd\u4f1a\u5f71\u54cd\u4f9d\u8d56\u4e8e\u7279\u5b9aPython\u7248\u672c\u7684\u7a0b\u5e8f\u3002\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u865a\u62df\u73af\u5883\u6216\u5bb9\u5668\u5316\u89e3\u51b3\u65b9\u6848\uff0c\u8fd9\u4e9b\u73af\u5883\u4e2d\u7684\u7a0b\u5e8f\u4e0d\u4f1a\u53d7\u5230\u5f71\u54cd\u3002\u5efa\u8bae\u5728\u5378\u8f7d\u4e4b\u524d\u68c0\u67e5\u4f9d\u8d56\u4e8e\u8be5Python\u7248\u672c\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u8003\u8651\u4f7f\u7528\u7248\u672c\u7ba1\u7406\u5de5\u5177\u6765\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\u3002<\/p>\n<p><strong>\u5982\u4f55\u786e\u4fdd\u6210\u529f\u5378\u8f7d\u4e86Python\uff1f<\/strong><br \/>\u5728Windows\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\u754c\u9762\u786e\u8ba4\u5df2\u6210\u529f\u5378\u8f7dPython\u3002\u5982\u679c\u4f7f\u7528\u547d\u4ee4\u884c\u5378\u8f7d\uff0c\u53ef\u4ee5\u8f93\u5165<code>python --version<\/code>\u6765\u9a8c\u8bc1\u662f\u5426\u4ecd\u663e\u793a\u8be5\u7248\u672c\u3002\u5728Mac\u6216Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>which python<\/code>\u6216<code>which python3<\/code>\u547d\u4ee4\u68c0\u67e5\u8be5\u7248\u672c\u662f\u5426\u4ecd\u5b58\u5728\u3002\u5982\u679c\u6ca1\u6709\u8fd4\u56de\u8def\u5f84\uff0c\u8868\u793aPython\u5df2\u6210\u529f\u5378\u8f7d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5378\u8f7dPython\u7684\u5176\u4ed6\u7248\u672c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a\u4f7f\u7528\u7cfb\u7edf\u7684\u5305\u7ba1\u7406\u5de5\u5177\u3001\u901a\u8fc7\u5b89\u88c5\u76ee\u5f55\u624b\u52a8\u5220\u9664\u3001\u4f7f\u7528Python\u81ea [&hellip;]","protected":false},"author":3,"featured_media":980144,"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\/980134"}],"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=980134"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/980134\/revisions"}],"predecessor-version":[{"id":980147,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/980134\/revisions\/980147"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/980144"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=980134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=980134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=980134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}