{"id":1087890,"date":"2025-01-08T13:39:18","date_gmt":"2025-01-08T05:39:18","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1087890.html"},"modified":"2025-01-08T13:39:20","modified_gmt":"2025-01-08T05:39:20","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8win7%e7%b3%bb%e7%bb%9f%e8%bf%90%e8%a1%8cpython-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1087890.html","title":{"rendered":"\u5982\u4f55\u5728win7\u7cfb\u7edf\u8fd0\u884cPython"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24200605\/9c126fdf-c184-49e2-a7d0-2d9c0dd95205.webp\" alt=\"\u5982\u4f55\u5728win7\u7cfb\u7edf\u8fd0\u884cPython\" \/><\/p>\n<p><p> <strong>\u4e00\u3001\u5b89\u88c5Python<\/strong><\/p>\n<\/p>\n<p><p>\u8981\u5728Win7\u7cfb\u7edf\u4e0a\u8fd0\u884cPython\uff0c\u9996\u5148\u9700\u8981\u5728\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5Python\u3002<strong>\u4ece\u5b98\u7f51\u4e0b\u8f7dPython\u5b89\u88c5\u5305\u3001\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/strong>\u3002\u4ecePython\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/downloads\/%EF%BC%89%E4%B8%8B%E8%BD%BD%E9%80%82%E7%94%A8%E4%BA%8EWindows\">https:\/\/www.python.org\/downloads\/\uff09\u4e0b\u8f7d\u9002\u7528\u4e8eWindows<\/a> 7\u7684Python\u5b89\u88c5\u5305\u3002\u8fd0\u884c\u4e0b\u8f7d\u7684\u5b89\u88c5\u7a0b\u5e8f\uff0c\u5e76\u786e\u4fdd\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u6837Python\u7684\u547d\u4ee4\u884c\u5de5\u5177\u4f1a\u88ab\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u65b9\u4fbf\u4ee5\u540e\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u3002<\/p>\n<\/p>\n<p><p><strong>\u8be6\u7ec6\u63cf\u8ff0\uff1a\u4e0b\u8f7d\u5e76\u5b89\u88c5Python<\/strong><\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8fdb\u5165Python\u5b98\u65b9\u7f51\u7ad9\u3002<\/li>\n<li>\u5728\u4e0b\u8f7d\u9875\u9762\u9009\u62e9\u9002\u7528\u4e8eWin7\u7684Python\u7248\u672c\uff08\u5efa\u8bae\u9009\u62e93.x\u7248\u672c\uff0c\u56e0\u4e3a2.x\u7248\u672c\u5df2\u7ecf\u505c\u6b62\u652f\u6301\uff09\u3002<\/li>\n<li>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u3002<\/li>\n<li>\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u7136\u540e\u70b9\u51fb\u201cInstall Now\u201d\u8fdb\u884c\u5b89\u88c5\u3002<\/li>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165<code>python --version<\/code>\u6765\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/li>\n<\/ol>\n<p><p><strong>\u4e8c\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/strong><\/p>\n<\/p>\n<p><p><strong>\u5728\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\u6dfb\u52a0Python\u8def\u5f84\u3001\u9a8c\u8bc1\u914d\u7f6e<\/strong>\u3002\u786e\u4fddPython\u7684\u5b89\u88c5\u8def\u5f84\u5df2\u7ecf\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\u3002\u5982\u679c\u5b89\u88c5\u65f6\u672a\u52fe\u9009\u201cAdd Python to PATH\u201d\uff0c\u53ef\u4ee5\u624b\u52a8\u6dfb\u52a0\u3002\u53f3\u952e\u70b9\u51fb\u201c\u8ba1\u7b97\u673a\u201d\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\uff0c\u7136\u540e\u70b9\u51fb\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\uff0c\u9009\u62e9\u201c\u73af\u5883\u53d8\u91cf\u201d\u3002\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u4e2d\u627e\u5230\u201cPath\u201d\u53d8\u91cf\uff0c\u70b9\u51fb\u201c\u7f16\u8f91\u201d\uff0c\u5c06Python\u7684\u5b89\u88c5\u8def\u5f84\uff08\u4f8b\u5982C:\\Python39\uff09\u6dfb\u52a0\u5230\u53d8\u91cf\u503c\u4e2d\uff0c\u5e76\u7528\u5206\u53f7\u5206\u9694\u3002<\/p>\n<\/p>\n<p><p><strong>\u4e09\u3001\u5b89\u88c5Python\u5305\u7ba1\u7406\u5de5\u5177<\/strong><\/p>\n<\/p>\n<p><p>Python\u81ea\u5e26\u7684\u5305\u7ba1\u7406\u5de5\u5177pip\u53ef\u4ee5\u5e2e\u52a9\u5b89\u88c5\u548c\u7ba1\u7406Python\u5305\u3002<strong>\u901a\u8fc7\u547d\u4ee4\u884c\u5b89\u88c5pip\u3001\u5347\u7ea7pip<\/strong>\u3002\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python -m ensurepip<\/code>\u6765\u5b89\u88c5pip\u3002\u5982\u679c\u5df2\u7ecf\u5b89\u88c5\u4e86pip\uff0c\u53ef\u4ee5\u901a\u8fc7<code>python -m pip install --upgrade pip<\/code>\u6765\u5347\u7ea7\u5230\u6700\u65b0\u7248\u672c\u3002<\/p>\n<\/p>\n<p><p><strong>\u56db\u3001\u5b89\u88c5Python\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/strong><\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u66f4\u65b9\u4fbf\u5730\u7f16\u5199\u548c\u8c03\u8bd5Python\u4ee3\u7801\uff0c\u53ef\u4ee5\u5b89\u88c5\u4e00\u4e2aPython\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3002<strong>\u9009\u62e9\u5408\u9002\u7684IDE\u3001\u5b89\u88c5IDE\u3001\u914d\u7f6eIDE<\/strong>\u3002\u5e38\u7528\u7684Python IDE\u5305\u62ecPyCharm\u3001Visual Studio Code\u3001IDLE\u7b49\u3002\u53ef\u4ee5\u6839\u636e\u4e2a\u4eba\u504f\u597d\u9009\u62e9\u5408\u9002\u7684IDE\uff0c\u5e76\u6839\u636e\u5b89\u88c5\u5411\u5bfc\u8fdb\u884c\u5b89\u88c5\u548c\u914d\u7f6e\u3002<\/p>\n<\/p>\n<p><p><strong>\u4e94\u3001\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u597dPython\u548cIDE\u540e\uff0c\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<strong>\u521b\u5efaPython\u811a\u672c\u6587\u4ef6\u3001\u7f16\u5199\u4ee3\u7801\u3001\u8fd0\u884c\u4ee3\u7801<\/strong>\u3002\u5728IDE\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\uff08\u4f8b\u5982test.py\uff09\uff0c\u7136\u540e\u7f16\u5199Python\u4ee3\u7801\u3002\u4fdd\u5b58\u6587\u4ef6\u540e\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728IDE\u4e2d\u8fd0\u884c\u4ee3\u7801\uff0c\u6216\u8005\u5728\u547d\u4ee4\u884c\u4e2d\u901a\u8fc7<code>python test.py<\/code>\u6765\u8fd0\u884c\u3002<\/p>\n<\/p>\n<p><p><strong>\u516d\u3001\u89e3\u51b3\u5e38\u89c1\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u5728Win7\u7cfb\u7edf\u4e0a\u8fd0\u884cPython\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u3002<strong>\u89e3\u51b3\u8def\u5f84\u95ee\u9898\u3001\u5b89\u88c5\u5305\u95ee\u9898\u3001\u7248\u672c\u517c\u5bb9\u6027\u95ee\u9898<\/strong>\u3002\u4f8b\u5982\uff0c\u5982\u679c\u547d\u4ee4\u884c\u4e2d\u63d0\u793a\u627e\u4e0d\u5230Python\u547d\u4ee4\uff0c\u53ef\u80fd\u662f\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u4e0d\u6b63\u786e\uff1b\u5982\u679c\u5b89\u88c5Python\u5305\u65f6\u9047\u5230\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u66f4\u6362\u955c\u50cf\u6e90\uff1b\u5982\u679c\u9047\u5230\u7248\u672c\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u53ef\u4ee5\u5b89\u88c5\u9002\u7528\u4e8e\u5f53\u524dPython\u7248\u672c\u7684\u5e93\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5b89\u88c5Python<\/h3>\n<\/p>\n<p><p>\u5728Windows 7\u7cfb\u7edf\u4e0a\u8fd0\u884cPython\u7684\u7b2c\u4e00\u6b65\u662f\u5b89\u88c5Python\u89e3\u91ca\u5668\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><p><strong>1. \u4ece\u5b98\u7f51\u4e0b\u8f7dPython\u5b89\u88c5\u5305<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff1a<a href=\"https:\/\/www.python.org\/\">https:\/\/www.python.org\/<\/a><\/li>\n<li>\u5728\u7f51\u7ad9\u9876\u90e8\u5bfc\u822a\u680f\u4e2d\u9009\u62e9\u201cDownloads\u201d\u9009\u9879\u3002<\/li>\n<li>\u5728\u4e0b\u8f7d\u9875\u9762\u4e2d\uff0c\u9009\u62e9\u9002\u7528\u4e8eWindows\u7684Python\u7248\u672c\u3002\u5efa\u8bae\u9009\u62e9Python 3.x\u7248\u672c\uff0c\u56e0\u4e3aPython 2.x\u5df2\u7ecf\u505c\u6b62\u652f\u6301\u3002<\/li>\n<\/ul>\n<p><p><strong>2. \u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u5b89\u88c5\u5305\u6587\u4ef6\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u3002<\/li>\n<li>\u5728\u5b89\u88c5\u754c\u9762\u4e2d\uff0c\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u4ee5\u786e\u4fddPython\u7684\u547d\u4ee4\u884c\u5de5\u5177\u53ef\u4ee5\u5728\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\u4f7f\u7528\u3002<\/li>\n<li>\u70b9\u51fb\u201cInstall Now\u201d\u6309\u94ae\u8fdb\u884c\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<p><p><strong>3. \u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08\u6309\u4e0bWin+R\u952e\uff0c\u8f93\u5165cmd\u5e76\u56de\u8f66\uff09\u3002<\/li>\n<li>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165<code>python --version<\/code>\uff0c\u5982\u679c\u663e\u793aPython\u7248\u672c\u53f7\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<\/li>\n<\/ul>\n<p><h3>\u4e8c\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/h3>\n<\/p>\n<p><p>\u786e\u4fddPython\u7684\u5b89\u88c5\u8def\u5f84\u88ab\u6dfb\u52a0\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u4ee5\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u8c03\u7528Python\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u6253\u5f00\u7cfb\u7edf\u5c5e\u6027<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u53f3\u952e\u70b9\u51fb\u201c\u8ba1\u7b97\u673a\u201d\u56fe\u6807\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\u3002<\/li>\n<li>\u5728\u7cfb\u7edf\u5c5e\u6027\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\u5de6\u4fa7\u7684\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\u94fe\u63a5\u3002<\/li>\n<\/ul>\n<p><p><strong>2. \u7f16\u8f91\u73af\u5883\u53d8\u91cf<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u7cfb\u7edf\u5c5e\u6027\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u6309\u94ae\u3002<\/li>\n<li>\u5728\u73af\u5883\u53d8\u91cf\u7a97\u53e3\u4e2d\uff0c\u627e\u5230\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u4e0b\u7684\u201cPath\u201d\u53d8\u91cf\uff0c\u9009\u4e2d\u5e76\u70b9\u51fb\u201c\u7f16\u8f91\u201d\u3002<\/li>\n<li>\u5728\u201c\u7f16\u8f91\u73af\u5883\u53d8\u91cf\u201d\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\u201c\u65b0\u5efa\u201d\uff0c\u7136\u540e\u8f93\u5165Python\u7684\u5b89\u88c5\u8def\u5f84\uff08\u4f8b\u5982C:\\Python39\uff09\u3002<\/li>\n<li>\u70b9\u51fb\u201c\u786e\u5b9a\u201d\u4fdd\u5b58\u66f4\u6539\u3002<\/li>\n<\/ul>\n<p><p><strong>3. \u9a8c\u8bc1\u73af\u5883\u53d8\u91cf<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165<code>python<\/code>\uff0c\u5982\u679c\u8fdb\u5165Python\u4ea4\u4e92\u6a21\u5f0f\uff0c\u8bf4\u660e\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u6210\u529f\u3002<\/li>\n<\/ul>\n<p><h3>\u4e09\u3001\u5b89\u88c5Python\u5305\u7ba1\u7406\u5de5\u5177<\/h3>\n<\/p>\n<p><p>Python\u81ea\u5e26\u7684\u5305\u7ba1\u7406\u5de5\u5177pip\u53ef\u4ee5\u5e2e\u52a9\u5b89\u88c5\u548c\u7ba1\u7406\u7b2c\u4e09\u65b9\u5e93\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u5b89\u88c5pip<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165<code>python -m ensurepip<\/code>\uff0c\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/li>\n<li>\u8fd9\u5c06\u5b89\u88c5pip\u5de5\u5177\u3002<\/li>\n<\/ul>\n<p><p><strong>2. \u5347\u7ea7pip<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4<code>python -m pip install --upgrade pip<\/code>\u6765\u5347\u7ea7\u5230\u6700\u65b0\u7248\u672c\u3002<\/li>\n<\/ul>\n<p><p><strong>3. \u9a8c\u8bc1pip\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165<code>pip --version<\/code>\uff0c\u5982\u679c\u663e\u793apip\u7248\u672c\u53f7\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<\/li>\n<\/ul>\n<p><h3>\u56db\u3001\u5b89\u88c5Python\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u66f4\u65b9\u4fbf\u5730\u7f16\u5199\u548c\u8c03\u8bd5Python\u4ee3\u7801\uff0c\u53ef\u4ee5\u5b89\u88c5\u4e00\u4e2aPython\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u9009\u62e9\u5408\u9002\u7684IDE<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5e38\u7528\u7684Python IDE\u5305\u62ecPyCharm\u3001Visual Studio Code\u3001IDLE\u7b49\u3002<\/li>\n<li>PyCharm\u662f\u529f\u80fd\u5f3a\u5927\u7684\u4e13\u4e1aIDE\uff0c\u9002\u5408\u5927\u89c4\u6a21\u9879\u76ee\u5f00\u53d1\u3002<\/li>\n<li>Visual Studio Code\u662f\u8f7b\u91cf\u7ea7\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u9002\u5408\u591a\u8bed\u8a00\u5f00\u53d1\u3002<\/li>\n<li>IDLE\u662fPython\u81ea\u5e26\u7684\u7b80\u5355IDE\uff0c\u9002\u5408\u521d\u5b66\u8005\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<p><p><strong>2. \u5b89\u88c5IDE<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4ee5PyCharm\u4e3a\u4f8b\uff0c\u8bbf\u95eePyCharm\u5b98\u65b9\u7f51\u7ad9\uff1a<a href=\"https:\/\/www.jetbrains.com\/pycharm\/\">https:\/\/www.jetbr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ns.com\/pycharm\/<\/a><\/li>\n<li>\u4e0b\u8f7d\u9002\u7528\u4e8eWindows\u7684\u5b89\u88c5\u5305\uff0c\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\u5e76\u6309\u7167\u5411\u5bfc\u8fdb\u884c\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<p><p><strong>3. \u914d\u7f6eIDE<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u5b89\u88c5\u597d\u7684IDE\uff0c\u5728\u6b22\u8fce\u754c\u9762\u4e2d\u9009\u62e9\u201cCreate New Project\u201d\u4ee5\u521b\u5efa\u65b0\u7684Python\u9879\u76ee\u3002<\/li>\n<li>\u5728\u9879\u76ee\u8bbe\u7f6e\u4e2d\uff0c\u9009\u62e9Python\u89e3\u91ca\u5668\u8def\u5f84\uff08\u4f8b\u5982C:\\Python39\\python.exe\uff09\u3002<\/li>\n<li>\u5b8c\u6210\u9879\u76ee\u521b\u5efa\u540e\uff0c\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199Python\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<p><h3>\u4e94\u3001\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u5b89\u88c5\u597dPython\u548cIDE\u540e\uff0c\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u521b\u5efaPython\u811a\u672c\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728IDE\u4e2d\uff0c\u9009\u62e9\u201cFile\u201d\u83dc\u5355\uff0c\u70b9\u51fb\u201cNew\u201d\u9009\u9879\uff0c\u7136\u540e\u9009\u62e9\u201cPython File\u201d\u4ee5\u521b\u5efa\u65b0\u7684Python\u811a\u672c\u6587\u4ef6\u3002<\/li>\n<li>\u4e3a\u6587\u4ef6\u547d\u540d\uff08\u4f8b\u5982test.py\uff09\uff0c\u5e76\u70b9\u51fb\u201cOK\u201d\u6309\u94ae\u3002<\/li>\n<\/ul>\n<p><p><strong>2. \u7f16\u5199\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u65b0\u5efa\u7684Python\u6587\u4ef6\u4e2d\uff0c\u7f16\u5199Python\u4ee3\u7801\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>3. \u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728IDE\u4e2d\uff0c\u53ef\u4ee5\u76f4\u63a5\u70b9\u51fb\u201cRun\u201d\u6309\u94ae\u8fd0\u884c\u4ee3\u7801\u3002<\/li>\n<li>\u6216\u8005\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\uff0c\u5bfc\u822a\u5230\u811a\u672c\u6587\u4ef6\u6240\u5728\u76ee\u5f55\uff0c\u8f93\u5165<code>python test.py<\/code>\u8fd0\u884c\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<p><h3>\u516d\u3001\u89e3\u51b3\u5e38\u89c1\u95ee\u9898<\/h3>\n<\/p>\n<p><p>\u5728Win7\u7cfb\u7edf\u4e0a\u8fd0\u884cPython\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u8def\u5f84\u95ee\u9898<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5982\u679c\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165<code>python<\/code>\u6216<code>pip<\/code>\u65f6\u63d0\u793a\u627e\u4e0d\u5230\u547d\u4ee4\uff0c\u53ef\u80fd\u662f\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u4e0d\u6b63\u786e\u3002<\/li>\n<li>\u68c0\u67e5Python\u7684\u5b89\u88c5\u8def\u5f84\u662f\u5426\u6b63\u786e\u6dfb\u52a0\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\u3002<\/li>\n<\/ul>\n<p><p><strong>2. \u5b89\u88c5\u5305\u95ee\u9898<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u7f51\u7edc\u95ee\u9898\u6216\u7248\u672c\u517c\u5bb9\u95ee\u9898\u3002<\/li>\n<li>\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528\u56fd\u5185\u955c\u50cf\u6e90\u8fdb\u884c\u5b89\u88c5\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">pip install \u5305\u540d -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>3. \u7248\u672c\u517c\u5bb9\u6027\u95ee\u9898<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u67d0\u4e9b\u7b2c\u4e09\u65b9\u5e93\u53ef\u80fd\u4e0d\u652f\u6301\u6700\u65b0\u7248\u672c\u7684Python\u3002<\/li>\n<li>\u53ef\u4ee5\u5c1d\u8bd5\u5b89\u88c5\u9002\u7528\u4e8e\u5f53\u524dPython\u7248\u672c\u7684\u5e93\uff0c\u6216\u4f7f\u7528\u865a\u62df\u73af\u5883\u7ba1\u7406\u4e0d\u540c\u7248\u672c\u7684\u5e93\u3002<\/li>\n<\/ul>\n<p><h3>\u4e03\u3001\u4f7f\u7528\u865a\u62df\u73af\u5883<\/h3>\n<\/p>\n<p><p>\u5728\u5f00\u53d1\u4e0d\u540c\u9879\u76ee\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u4e0d\u540c\u7248\u672c\u7684\u5e93\u3002\u865a\u62df\u73af\u5883\u53ef\u4ee5\u5e2e\u52a9\u9694\u79bb\u4e0d\u540c\u9879\u76ee\u7684\u4f9d\u8d56\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u521b\u5efa\u865a\u62df\u73af\u5883<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\uff0c\u5bfc\u822a\u5230\u9879\u76ee\u76ee\u5f55\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">python -m venv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li>\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3amyenv\u7684\u865a\u62df\u73af\u5883\u3002<\/li>\n<\/ul>\n<p><p><strong>2. \u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">myenv\\Scripts\\activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li>\u6fc0\u6d3b\u540e\uff0c\u547d\u4ee4\u63d0\u793a\u7b26\u524d\u7f00\u4f1a\u663e\u793a\u865a\u62df\u73af\u5883\u540d\u79f0\u3002<\/li>\n<\/ul>\n<p><p><strong>3. \u5b89\u88c5\u4f9d\u8d56\u5e93<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u865a\u62df\u73af\u5883\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528pip\u5b89\u88c5\u9879\u76ee\u6240\u9700\u7684\u4f9d\u8d56\u5e93\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">pip install requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>4. \u9000\u51fa\u865a\u62df\u73af\u5883<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5b8c\u6210\u5f00\u53d1\u540e\uff0c\u53ef\u4ee5\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u9000\u51fa\u865a\u62df\u73af\u5883\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">deactivate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u4f7f\u7528Jupyter Notebook<\/h3>\n<\/p>\n<p><p>Jupyter Notebook\u662f\u4e00\u79cd\u4ea4\u4e92\u5f0f\u5f00\u53d1\u73af\u5883\uff0c\u9002\u5408\u6570\u636e\u79d1\u5b66\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u9879\u76ee\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u5b89\u88c5Jupyter Notebook<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Jupyter Notebook\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">pip install notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>2. \u542f\u52a8Jupyter Notebook<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8Jupyter Notebook\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">jupyter notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li>\u8fd9\u5c06\u6253\u5f00\u9ed8\u8ba4\u6d4f\u89c8\u5668\uff0c\u5e76\u8fdb\u5165Jupyter Notebook\u754c\u9762\u3002<\/li>\n<\/ul>\n<p><p><strong>3. \u521b\u5efa\u548c\u8fd0\u884cNotebook<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728Jupyter Notebook\u754c\u9762\u4e2d\uff0c\u70b9\u51fb\u201cNew\u201d\u6309\u94ae\uff0c\u9009\u62e9\u201cPython 3\u201d\u4ee5\u521b\u5efa\u65b0\u7684Notebook\u3002<\/li>\n<li>\u5728Notebook\u4e2d\uff0c\u53ef\u4ee5\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\uff0c\u5e76\u5b9e\u65f6\u67e5\u770b\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<p><h3>\u4e5d\u3001\u5b66\u4e60\u8d44\u6e90\u548c\u793e\u533a<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u66f4\u597d\u5730\u5b66\u4e60\u548c\u638c\u63e1Python\uff0c\u53ef\u4ee5\u5229\u7528\u4ee5\u4e0b\u5b66\u4e60\u8d44\u6e90\u548c\u793e\u533a\u3002<\/p>\n<\/p>\n<p><p><strong>1. \u5b98\u65b9\u6587\u6863<\/strong><\/p>\n<\/p>\n<ul>\n<li>Python\u5b98\u65b9\u7f51\u7ad9\u63d0\u4f9b\u4e86\u8be6\u7ec6\u7684\u5b98\u65b9\u6587\u6863\uff0c\u5305\u62ec\u8bed\u8a00\u53c2\u8003\u3001\u5e93\u53c2\u8003\u548c\u6559\u7a0b\uff1a<a href=\"https:\/\/docs.python.org\/\">https:\/\/docs.python.org\/<\/a><\/li>\n<\/ul>\n<p><p><strong>2. \u5728\u7ebf\u8bfe\u7a0b<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u8bb8\u591a\u5728\u7ebf\u5b66\u4e60\u5e73\u53f0\u63d0\u4f9bPython\u8bfe\u7a0b\uff0c\u4f8b\u5982Coursera\u3001edX\u3001Udemy\u7b49\u3002<\/li>\n<\/ul>\n<p><p><strong>3. \u5f00\u6e90\u793e\u533a<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u53c2\u4e0e\u5f00\u6e90\u9879\u76ee\u662f\u63d0\u5347\u7f16\u7a0b\u6280\u80fd\u7684\u597d\u65b9\u6cd5\u3002\u53ef\u4ee5\u5728GitHub\u4e0a\u627e\u5230\u8bb8\u591aPython\u5f00\u6e90\u9879\u76ee\uff1a<a href=\"https:\/\/github.com\/\">https:\/\/github.com\/<\/a><\/li>\n<\/ul>\n<p><p><strong>4. \u6280\u672f\u8bba\u575b<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u901a\u8fc7\u6280\u672f\u8bba\u575b\u548c\u95ee\u7b54\u793e\u533a\u53ef\u4ee5\u83b7\u5f97\u5e2e\u52a9\u548c\u4ea4\u6d41\u7ecf\u9a8c\uff0c\u4f8b\u5982Stack Overflow\u3001Reddit\u7684Python\u7248\u5757\u7b49\u3002<\/li>\n<\/ul>\n<p><h3>\u5341\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Win7\u7cfb\u7edf\u4e0a\u8fd0\u884cPython\u6d89\u53ca\u5b89\u88c5Python\u89e3\u91ca\u5668\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u5b89\u88c5\u5305\u7ba1\u7406\u5de5\u5177\u3001\u9009\u62e9\u548c\u5b89\u88c5IDE\u3001\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801\u3001\u89e3\u51b3\u5e38\u89c1\u95ee\u9898\u3001\u4f7f\u7528\u865a\u62df\u73af\u5883\u548cJupyter Notebook\u3001\u5229\u7528\u5b66\u4e60\u8d44\u6e90\u548c\u793e\u533a\u7b49\u591a\u4e2a\u6b65\u9aa4\u3002\u901a\u8fc7\u638c\u63e1\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u53ef\u4ee5\u5728Windows 7\u7cfb\u7edf\u4e0a\u987a\u5229\u8fd0\u884cPython\uff0c\u5e76\u8fdb\u884c\u5f00\u53d1\u548c\u5b66\u4e60\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff0c\u5982\u679c\u9047\u5230\u4efb\u4f55\u95ee\u9898\uff0c\u6b22\u8fce\u7559\u8a00\u8ba8\u8bba\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728Windows 7\u4e0a\u5982\u4f55\u5b89\u88c5Python\uff1f<\/strong><br \/>\u8981\u5728Windows 7\u4e0a\u5b89\u88c5Python\uff0c\u60a8\u53ef\u4ee5\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff08python.org\uff09\uff0c\u4e0b\u8f7d\u9002\u7528\u4e8eWindows\u7684\u6700\u65b0\u7248\u672c\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u53cc\u51fb\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\uff0c\u786e\u4fdd\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u4ee5\u4fbf\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165<code>python<\/code>\u6765\u68c0\u67e5\u662f\u5426\u6210\u529f\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5728Windows 7\u4e0a\u5982\u4f55\u8fd0\u884cPython\u811a\u672c\uff1f<\/strong><br \/>\u8fd0\u884cPython\u811a\u672c\u7684\u65b9\u6cd5\u5f88\u7b80\u5355\u3002\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\uff0c\u5bfc\u822a\u5230\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\uff0c\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5207\u6362\u76ee\u5f55\uff0c\u7136\u540e\u8f93\u5165<code>python script_name.py<\/code>\uff08\u5c06<code>script_name.py<\/code>\u66ff\u6362\u4e3a\u60a8\u7684\u811a\u672c\u6587\u4ef6\u540d\uff09\u6765\u6267\u884c\u811a\u672c\u3002\u786e\u4fddPython\u5df2\u6b63\u786e\u5b89\u88c5\u5e76\u4e14\u8def\u5f84\u5df2\u8bbe\u7f6e\u3002<\/p>\n<p><strong>\u4f7f\u7528Windows 7\u7684Python\u5f00\u53d1\u73af\u5883\u6709\u54ea\u4e9b\u63a8\u8350\uff1f<\/strong><br \/>\u5728Windows 7\u4e0a\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u5f00\u53d1\u73af\u5883\u6765\u7f16\u5199Python\u4ee3\u7801\u3002\u5e38\u89c1\u7684\u9009\u62e9\u5305\u62ecIDLE\uff08Python\u81ea\u5e26\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff09\u3001PyCharm\uff08\u529f\u80fd\u5f3a\u5927\u7684IDE\uff0c\u9002\u5408\u5927\u578b\u9879\u76ee\uff09\u3001\u548cVisual Studio Code\uff08\u8f7b\u91cf\u7ea7\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u63d2\u4ef6\uff09\u3002\u6839\u636e\u60a8\u7684\u9700\u6c42\u9009\u62e9\u6700\u9002\u5408\u7684\u5f00\u53d1\u73af\u5883\uff0c\u53ef\u4ee5\u63d0\u5347\u7f16\u7a0b\u6548\u7387\u548c\u4f53\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e00\u3001\u5b89\u88c5Python \u8981\u5728Win7\u7cfb\u7edf\u4e0a\u8fd0\u884cPython\uff0c\u9996\u5148\u9700\u8981\u5728\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5Python\u3002\u4ece\u5b98\u7f51\u4e0b\u8f7dPyt [&hellip;]","protected":false},"author":3,"featured_media":1087893,"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\/1087890"}],"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=1087890"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1087890\/revisions"}],"predecessor-version":[{"id":1087895,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1087890\/revisions\/1087895"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1087893"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1087890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1087890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1087890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}