{"id":993716,"date":"2024-12-27T08:48:19","date_gmt":"2024-12-27T00:48:19","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/993716.html"},"modified":"2024-12-27T08:48:22","modified_gmt":"2024-12-27T00:48:22","slug":"%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85%e5%b9%b6%e4%b8%8b%e8%bd%bdpython","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/993716.html","title":{"rendered":"\u5982\u4f55\u5b89\u88c5\u5e76\u4e0b\u8f7dpython"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25071013\/fff7e5c3-155a-4190-83c3-267603a8f557.webp\" alt=\"\u5982\u4f55\u5b89\u88c5\u5e76\u4e0b\u8f7dpython\" \/><\/p>\n<p><p> <strong>\u8981\u5b89\u88c5\u5e76\u4e0b\u8f7dPython\uff0c\u9996\u5148\u9700\u8981\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff0c\u9009\u62e9\u5408\u9002\u7684\u7248\u672c\u8fdb\u884c\u4e0b\u8f7d\u3001\u7136\u540e\u6839\u636e\u64cd\u4f5c\u7cfb\u7edf\u7684\u4e0d\u540c\uff0c\u8fdb\u884c\u5b89\u88c5\u7a0b\u5e8f\u7684\u8fd0\u884c\u4e0e\u914d\u7f6e\u3001\u6700\u540e\u901a\u8fc7\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/strong>\u5728\u8be6\u7ec6\u63cf\u8ff0\u4e2d\uff0c\u6211\u4eec\u5c06\u91cd\u70b9\u8ba8\u8bba\u5982\u4f55\u4e3a\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\uff08Windows\u3001macOS\u548cLinux\uff09\u8fdb\u884cPython\u7684\u4e0b\u8f7d\u4e0e\u5b89\u88c5\uff0c\u5e76\u786e\u4fdd\u5176\u6b63\u786e\u914d\u7f6e\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001WINDOWS\u7cfb\u7edf\u4e0b\u7684PYTHON\u5b89\u88c5\u4e0e\u4e0b\u8f7d<\/p>\n<\/p>\n<p><p>\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u5b89\u88c5Python\u76f8\u5bf9\u7b80\u5355\uff0c\u5b98\u65b9\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6613\u4e8e\u4f7f\u7528\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bbf\u95ee\u5b98\u65b9\u7f51\u7ad9\u5e76\u4e0b\u8f7d<\/strong><\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/%EF%BC%89%E3%80%82%E5%9C%A8%E9%A6%96%E9%A1%B5%EF%BC%8C%E4%BD%A0%E5%8F%AF%E4%BB%A5%E7%9C%8B%E5%88%B0%E4%B8%80%E4%B8%AA%E2%80%9CDownloads%E2%80%9D%E9%80%89%E9%A1%B9%E3%80%82%E7%82%B9%E5%87%BB%E5%AE%83%EF%BC%8C%E7%BD%91%E7%AB%99%E4%BC%9A%E8%87%AA%E5%8A%A8%E6%8E%A8%E8%8D%90%E9%80%82%E5%90%88%E4%BD%A0%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9A%84%E6%9C%80%E6%96%B0%E7%A8%B3%E5%AE%9A%E7%89%88%E6%9C%AC%E3%80%82%E7%82%B9%E5%87%BB%E2%80%9CDownload\">https:\/\/www.python.org\/\uff09\u3002\u5728\u9996\u9875\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u4e00\u4e2a\u201cDownloads\u201d\u9009\u9879\u3002\u70b9\u51fb\u5b83\uff0c\u7f51\u7ad9\u4f1a\u81ea\u52a8\u63a8\u8350\u9002\u5408\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684\u6700\u65b0\u7a33\u5b9a\u7248\u672c\u3002\u70b9\u51fb\u201cDownload<\/a> Python [version number]\u201d\u6309\u94ae\u5f00\u59cb\u4e0b\u8f7d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f<\/strong><\/p>\n<\/p>\n<p><p>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u3002\u5728\u5b89\u88c5\u754c\u9762\u4e2d\uff0c\u786e\u4fdd\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u5c06\u81ea\u52a8\u5c06Python\u6dfb\u52a0\u5230\u4f60\u7684\u7cfb\u7edf\u8def\u5f84\uff0c\u65b9\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u3002\u7136\u540e\u9009\u62e9\u201cInstall Now\u201d\u8fdb\u884c\u9ed8\u8ba4\u5b89\u88c5\uff0c\u6216\u8005\u9009\u62e9\u201cCustomize installation\u201d\u8fdb\u884c\u81ea\u5b9a\u4e49\u5b89\u88c5\uff08\u901a\u5e38\u4e0d\u9700\u8981\uff09\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08\u53ef\u4ee5\u5728\u641c\u7d22\u680f\u4e2d\u8f93\u5165\u201ccmd\u201d\u627e\u5230\uff09\uff0c\u8f93\u5165<code>python --version<\/code>\uff0c\u5982\u679c\u663e\u793aPython\u7684\u7248\u672c\u53f7\uff0c\u5219\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002\u4f60\u4e5f\u53ef\u4ee5\u8f93\u5165<code>pip --version<\/code>\u6765\u68c0\u67e5pip\uff08Python\u7684\u5305\u7ba1\u7406\u5668\uff09\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001MACOS\u7cfb\u7edf\u4e0b\u7684PYTHON\u5b89\u88c5\u4e0e\u4e0b\u8f7d<\/p>\n<\/p>\n<p><p>\u5728macOS\u4e0a\u5b89\u88c5Python\u540c\u6837\u7b80\u5355\uff0c\u7cfb\u7edf\u81ea\u5e26\u7684Python\u7248\u672c\u901a\u5e38\u8f83\u8001\uff0c\u6240\u4ee5\u5efa\u8bae\u5b89\u88c5\u6700\u65b0\u7248\u672c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bbf\u95ee\u5b98\u65b9\u7f51\u7ad9\u5e76\u4e0b\u8f7d<\/strong><\/p>\n<\/p>\n<p><p>\u548cWindows\u4e00\u6837\uff0c\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff0c\u4e0b\u8f7d\u6700\u65b0\u7684macOS\u5b89\u88c5\u5305\u3002\u9009\u62e9\u9002\u5408\u4f60\u7cfb\u7edf\u67b6\u6784\u7684\u7248\u672c\uff08\u901a\u5e38\u662fx86-64\uff09\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f<\/strong><\/p>\n<\/p>\n<p><p>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u6253\u5f00.dmg\u6587\u4ef6\uff0c\u6309\u7167\u63d0\u793a\u5c06Python\u62d6\u5165\u5e94\u7528\u7a0b\u5e8f\u6587\u4ef6\u5939\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u201c\u7ec8\u7aef\u201d\u5e94\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u7ec8\u7aef\u4e2d\uff0c\u8f93\u5165<code>python3 --version<\/code>\u6765\u68c0\u67e5Python 3\u7684\u7248\u672c\u3002\u5982\u679c\u663e\u793a\u7248\u672c\u53f7\uff0c\u5219\u8868\u793a\u5b89\u88c5\u6210\u529f\u3002macOS\u901a\u5e38\u4f1a\u4fdd\u7559\u81ea\u5e26\u7684Python 2\uff0c\u56e0\u6b64\u9700\u8981\u4f7f\u7528<code>python3<\/code>\u547d\u4ee4\u6765\u542f\u52a8Python 3\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001LINUX\u7cfb\u7edf\u4e0b\u7684PYTHON\u5b89\u88c5\u4e0e\u4e0b\u8f7d<\/p>\n<\/p>\n<p><p>\u5927\u591a\u6570Linux\u53d1\u884c\u7248\u90fd\u9884\u88c5\u4e86Python\uff0c\u4f46\u901a\u5e38\u662fPython 2.x\u7248\u672c\u3002\u5b89\u88c5\u6700\u65b0\u7684Python 3.x\u7248\u672c\u662f\u63a8\u8350\u7684\u505a\u6cd5\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u66f4\u65b0\u8f6f\u4ef6\u5305<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u7ec8\u7aef\u4e2d\uff0c\u9996\u5148\u66f4\u65b0\u5305\u5217\u8868\u5e76\u5347\u7ea7\u7cfb\u7edf\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt update<\/p>\n<p>sudo apt upgrade<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python 3<\/strong><\/p>\n<\/p>\n<p><p>\u5728Debian\u6216Ubuntu\u7cfb\u7edf\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Python 3\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt install python3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u540c\u65f6\u5b89\u88c5pip\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt install python3-pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u8f93\u5165<code>python3 --version<\/code>\u6765\u9a8c\u8bc1\u5b89\u88c5\u3002\u5982\u679c\u663e\u793aPython 3\u7684\u7248\u672c\u53f7\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002\u540c\u65f6\u53ef\u4ee5\u8f93\u5165<code>pip3 --version<\/code>\u6765\u68c0\u67e5pip3\u662f\u5426\u5b89\u88c5\u6b63\u786e\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u4e0eIDE<\/p>\n<\/p>\n<p><p>\u5b89\u88c5Python\u540e\uff0c\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u989d\u5916\u7684\u914d\u7f6e\uff0c\u5c24\u5176\u662f\u5bf9\u4e8e\u5f00\u53d1\u8005\u800c\u8a00\uff0c\u914d\u7f6eIDE\u548c\u73af\u5883\u53d8\u91cf\u80fd\u66f4\u9ad8\u6548\u5730\u8fdb\u884c\u5f00\u53d1\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/strong><\/p>\n<\/p>\n<p><p>\u5bf9\u4e8eWindows\uff0c\u867d\u7136\u5b89\u88c5\u65f6\u53ef\u4ee5\u81ea\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u4f46\u6709\u65f6\u4ecd\u9700\u624b\u52a8\u914d\u7f6e\u3002\u6253\u5f00\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\uff0c\u8fdb\u5165\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\uff0c\u627e\u5230\u201c\u73af\u5883\u53d8\u91cf\u201d\uff0c\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u4e2d\u627e\u5230\u201cPath\u201d\u5e76\u7f16\u8f91\uff0c\u786e\u4fddPython\u7684\u5b89\u88c5\u8def\u5f84\u5728\u5176\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9009\u62e9\u548c\u914d\u7f6eIDE<\/strong><\/p>\n<\/p>\n<p><p>\u5e38\u7528\u7684Python\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u5305\u62ecPyCharm\u3001Visual Studio Code\u3001Sublime Text\u7b49\u3002\u4ee5Visual Studio Code\u4e3a\u4f8b\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5Visual Studio Code\u3002<\/li>\n<li>\u6253\u5f00Visual Studio Code\uff0c\u5b89\u88c5Python\u6269\u5c55\u63d2\u4ef6\u3002<\/li>\n<li>\u5728\u8bbe\u7f6e\u4e2d\uff0c\u5c06Python\u89e3\u91ca\u5668\u8bbe\u7f6e\u4e3a\u4f60\u5b89\u88c5\u7684Python\u7248\u672c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u5b89\u88c5\u5e38\u7528\u7684PYTHON\u5305<\/p>\n<\/p>\n<p><p>\u5b89\u88c5Python\u540e\uff0c\u901a\u5e38\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5e38\u7528\u7684Python\u5305\u6765\u6ee1\u8db3\u5f00\u53d1\u9700\u6c42\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528pip\u5b89\u88c5\u5305<\/strong><\/p>\n<\/p>\n<p><p>pip\u662fPython\u7684\u5305\u7ba1\u7406\u5668\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u5b89\u88c5Python\u5305\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install numpy<\/p>\n<p>pip install pandas<\/p>\n<p>pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e9b\u662f\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u636e\u5206\u6790\u4e2d\u5e38\u7528\u7684Python\u5e93\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u865a\u62df\u73af\u5883<\/strong><\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u907f\u514d\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u7684\u5305\u4f9d\u8d56\u51b2\u7a81\uff0c\u5efa\u8bae\u4f7f\u7528\u865a\u62df\u73af\u5883\u3002\u53ef\u4ee5\u4f7f\u7528<code>venv<\/code>\u6a21\u5757\u6765\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 -m venv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728Windows\u4e0a\uff1a<code>myenv\\Scripts\\activate<\/code><\/li>\n<li>\u5728macOS\/Linux\u4e0a\uff1a<code>source myenv\/bin\/activate<\/code><\/li>\n<\/ul>\n<p><p>\u6fc0\u6d3b\u540e\uff0c\u5b89\u88c5\u7684\u5305\u53ea\u4f1a\u5f71\u54cd\u5f53\u524d\u7684\u865a\u62df\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001\u4e86\u89e3PYTHON\u7248\u672c\u7ba1\u7406\u5de5\u5177<\/p>\n<\/p>\n<p><p>\u5728\u5f00\u53d1\u4e2d\uff0c\u53ef\u80fd\u9700\u8981\u5728\u4e0d\u540c\u7684\u9879\u76ee\u4e2d\u4f7f\u7528\u4e0d\u540c\u7684Python\u7248\u672c\uff0c\u8fd9\u65f6Python\u7248\u672c\u7ba1\u7406\u5de5\u5177\u5982<code>pyenv<\/code>\u5c31\u663e\u5f97\u5341\u5206\u6709\u7528\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5pyenv<\/strong><\/p>\n<\/p>\n<p><p>\u5728macOS\u548cLinux\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5pyenv\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">curl https:\/\/pyenv.run | bash<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728Windows\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pyenv-win<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528pyenv\u7ba1\u7406\u7248\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u4e0d\u540c\u7248\u672c\u7684Python\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyenv install 3.9.1<\/p>\n<p>pyenv install 3.8.6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u53ef\u4ee5\u4e3a\u4e0d\u540c\u7684\u9879\u76ee\u8bbe\u7f6e\u4e0d\u540c\u7684Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyenv local 3.9.1<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f7f\u7528<code>pyenv global<\/code>\u53ef\u4ee5\u8bbe\u7f6e\u5168\u5c40\u7684Python\u7248\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e03\u3001\u5904\u7406\u5b89\u88c5\u95ee\u9898\u4e0e\u5e38\u89c1\u9519\u8bef<\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u7684\u95ee\u9898\u548c\u9519\u8bef\uff0c\u9700\u8981\u4e86\u89e3\u5982\u4f55\u6392\u67e5\u548c\u89e3\u51b3\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8def\u5f84\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u540e\u5982\u679c\u547d\u4ee4\u884c\u63d0\u793a\u627e\u4e0d\u5230Python\uff0c\u53ef\u80fd\u662f\u56e0\u4e3a\u8def\u5f84\u914d\u7f6e\u9519\u8bef\u3002\u68c0\u67e5\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\uff0c\u786e\u4fddPython\u7684\u5b89\u88c5\u8def\u5f84\u5728\u5176\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6743\u9650\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u5728Linux\u548cmacOS\u4e0a\u5b89\u88c5\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>sudo<\/code>\u6765\u83b7\u5f97\u7ba1\u7406\u5458\u6743\u9650\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7248\u672c\u517c\u5bb9\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u67d0\u4e9b\u5305\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u7248\u672c\u517c\u5bb9\u95ee\u9898\u3002\u53ef\u4ee5\u901a\u8fc7<code>pip install package_name==version<\/code>\u6765\u6307\u5b9a\u7248\u672c\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5\u5e76\u4e0b\u8f7dPython\uff0c\u5e76\u8fdb\u884c\u57fa\u672c\u7684\u914d\u7f6e\u4ee5\u4fbf\u5f00\u59cbPython\u7f16\u7a0b\u3002Python\u5f3a\u5927\u7684\u751f\u6001\u7cfb\u7edf\u548c\u5e7f\u6cdb\u7684\u5e94\u7528\u9886\u57df\u4f7f\u5176\u6210\u4e3a\u73b0\u4ee3\u7f16\u7a0b\u8bed\u8a00\u7684\u91cd\u8981\u4e00\u5458\u3002\u5e0c\u671b\u901a\u8fc7\u8fd9\u7bc7\u6307\u5357\uff0c\u4f60\u80fd\u987a\u5229\u5b89\u88c5\u5e76\u5f00\u59cb\u4f7f\u7528Python\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684Python\u7248\u672c\u8fdb\u884c\u5b89\u88c5\uff1f<\/strong><br \/>\u5728\u9009\u62e9Python\u7248\u672c\u65f6\uff0c\u8003\u8651\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u548c\u9879\u76ee\u9700\u6c42\u3002\u5bf9\u4e8e\u65b0\u624b\uff0c\u5efa\u8bae\u4e0b\u8f7d\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\uff08\u5982Python 3.x\uff09\uff0c\u56e0\u4e3a\u5b83\u5305\u542b\u4e86\u6700\u65b0\u7684\u529f\u80fd\u548c\u5b89\u5168\u6027\u66f4\u65b0\u3002\u60a8\u8fd8\u9700\u67e5\u770b\u9879\u76ee\u7684\u517c\u5bb9\u6027\u8981\u6c42\uff0c\u4ee5\u786e\u4fdd\u6240\u9009\u7248\u672c\u53ef\u4ee5\u652f\u6301\u60a8\u6b63\u5728\u4f7f\u7528\u7684\u5e93\u548c\u6846\u67b6\u3002<\/p>\n<p><strong>\u5b89\u88c5Python\u65f6\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u7cfb\u7edf\u8981\u6c42\uff1f<\/strong><br \/>\u5728\u5b89\u88c5Python\u4e4b\u524d\uff0c\u68c0\u67e5\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u662f\u5426\u7b26\u5408\u6700\u4f4e\u7cfb\u7edf\u8981\u6c42\uff0c\u5305\u62ec\u5904\u7406\u5668\u67b6\u6784\u548c\u5185\u5b58\u3002\u5728Windows\u3001macOS\u548cLinux\u4e0a\uff0cPython\u7684\u5b89\u88c5\u7a0b\u5e8f\u6709\u6240\u4e0d\u540c\uff0c\u786e\u4fdd\u4e0b\u8f7d\u4e0e\u60a8\u7684\u7cfb\u7edf\u76f8\u5339\u914d\u7684\u7248\u672c\u3002\u6b64\u5916\uff0c\u786e\u4fdd\u60a8\u7684\u7cfb\u7edf\u5df2\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879\uff0c\u5982C\u7f16\u8bd1\u5668\uff0c\u7279\u522b\u662f\u5728Linux\u4e0a\u3002<\/p>\n<p><strong>\u4e0b\u8f7dPython\u540e\uff0c\u5982\u4f55\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\uff1f<\/strong><br \/>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u9a8c\u8bc1Python\u662f\u5426\u6b63\u786e\u5b89\u88c5\u3002\u5728Windows\u4e2d\uff0c\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\uff0c\u5728macOS\u548cLinux\u4e2d\u4e5f\u4f7f\u7528\u76f8\u540c\u7684\u547d\u4ee4\u3002\u5982\u679c\u6210\u529f\uff0c\u7cfb\u7edf\u5c06\u663e\u793a\u5df2\u5b89\u88c5\u7684Python\u7248\u672c\u53f7\u3002\u5982\u679c\u672a\u80fd\u663e\u793a\uff0c\u8bf7\u68c0\u67e5\u5b89\u88c5\u6b65\u9aa4\uff0c\u786e\u4fddPATH\u73af\u5883\u53d8\u91cf\u5df2\u6b63\u786e\u914d\u7f6e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5b89\u88c5\u5e76\u4e0b\u8f7dPython\uff0c\u9996\u5148\u9700\u8981\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff0c\u9009\u62e9\u5408\u9002\u7684\u7248\u672c\u8fdb\u884c\u4e0b\u8f7d\u3001\u7136\u540e\u6839\u636e\u64cd\u4f5c\u7cfb\u7edf\u7684\u4e0d\u540c\uff0c [&hellip;]","protected":false},"author":3,"featured_media":993730,"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\/993716"}],"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=993716"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/993716\/revisions"}],"predecessor-version":[{"id":993732,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/993716\/revisions\/993732"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/993730"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=993716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=993716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=993716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}