{"id":932885,"date":"2024-12-26T18:06:30","date_gmt":"2024-12-26T10:06:30","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/932885.html"},"modified":"2024-12-26T18:06:32","modified_gmt":"2024-12-26T10:06:32","slug":"python%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85mlpy","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/932885.html","title":{"rendered":"python\u5982\u4f55\u5b89\u88c5mlpy"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25070541\/1414aa57-ae6d-405d-ad84-b77c320801bd.webp\" alt=\"python\u5982\u4f55\u5b89\u88c5mlpy\" \/><\/p>\n<p><p> <strong>\u5b89\u88c5mlpy\u7684\u6b65\u9aa4\u5305\u62ec\uff1a\u786e\u4fddPython\u7248\u672c\u517c\u5bb9\u3001\u5b89\u88c5\u4f9d\u8d56\u5e93\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5b89\u88c5\u3001\u89e3\u51b3\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u51fa\u73b0\u7684\u95ee\u9898\u3002<\/strong>\u5176\u4e2d\uff0c\u6700\u5173\u952e\u7684\u4e00\u6b65\u662f\u786e\u4fdd\u6240\u6709\u4f9d\u8d56\u5e93\u90fd\u6b63\u786e\u5b89\u88c5\uff0c\u56e0\u4e3amlpy\u4f9d\u8d56\u4e8e\u591a\u4e2a\u79d1\u5b66\u8ba1\u7b97\u5e93\u3002\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u987a\u5229\u5b89\u88c5mlpy\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u786e\u4fddPython\u7248\u672c\u517c\u5bb9<\/h3>\n<\/p>\n<p><p>mlpy\u662f\u4e00\u4e2a\u4e13\u4e3a\u79d1\u5b66\u8ba1\u7b97\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u8bbe\u8ba1\u7684Python\u5e93\uff0c\u4f46\u5b83\u5e76\u4e0d\u652f\u6301\u6240\u6709\u7248\u672c\u7684Python\u3002\u901a\u5e38\uff0cmlpy\u652f\u6301\u7684Python\u7248\u672c\u5305\u62ec2.7\u548c\u4e00\u4e9b\u8f83\u65e9\u76843.x\u7248\u672c\u3002\u56e0\u6b64\uff0c\u5728\u5f00\u59cb\u5b89\u88c5\u4e4b\u524d\uff0c\u4f60\u9700\u8981\u786e\u4fdd\u4f60\u7684Python\u7248\u672c\u4e0emlpy\u517c\u5bb9\u3002<\/p>\n<\/p>\n<ul>\n<li><strong>\u68c0\u67e5Python\u7248\u672c<\/strong>\uff1a\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python --version<\/code>\u6765\u68c0\u67e5\u5f53\u524d\u7684Python\u7248\u672c\u3002<\/li>\n<li><strong>\u5b89\u88c5\u517c\u5bb9\u7684Python\u7248\u672c<\/strong>\uff1a\u5982\u679c\u4f60\u7684\u7248\u672c\u4e0d\u517c\u5bb9\uff0c\u8003\u8651\u5b89\u88c5\u4e00\u4e2a\u517c\u5bb9\u7684\u7248\u672c\u3002\u53ef\u4ee5\u901a\u8fc7Anaconda\u7b49\u5de5\u5177\u65b9\u4fbf\u5730\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\u3002<\/li>\n<\/ul>\n<p><h3>\u4e8c\u3001\u5b89\u88c5\u4f9d\u8d56\u5e93<\/h3>\n<\/p>\n<p><p>mlpy\u4f9d\u8d56\u4e8e\u4e00\u7cfb\u5217\u79d1\u5b66\u8ba1\u7b97\u5e93\uff0c\u5982NumPy\u3001SciPy\u548cMatplotlib\u3002\u5728\u5b89\u88c5mlpy\u4e4b\u524d\uff0c\u5fc5\u987b\u786e\u4fdd\u8fd9\u4e9b\u5e93\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u3002<\/p>\n<\/p>\n<ul>\n<li><strong>NumPy<\/strong>\uff1a\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4<code>pip install numpy<\/code>\u6765\u5b89\u88c5\u3002NumPy\u662fPython\u4e2d\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\u7684\u6838\u5fc3\u5e93\u3002<\/li>\n<li><strong>SciPy<\/strong>\uff1a\u4f7f\u7528\u547d\u4ee4<code>pip install scipy<\/code>\u8fdb\u884c\u5b89\u88c5\u3002SciPy\u662f\u4e00\u4e2a\u4f9d\u8d56\u4e8eNumPy\u7684\u5e93\uff0c\u63d0\u4f9b\u4e86\u8bb8\u591a\u9ad8\u7ea7\u7684\u79d1\u5b66\u8ba1\u7b97\u529f\u80fd\u3002<\/li>\n<li><strong>Matplotlib<\/strong>\uff1a\u7528\u547d\u4ee4<code>pip install matplotlib<\/code>\u6765\u5b89\u88c5\u3002Matplotlib\u7528\u4e8e\u6570\u636e\u7684\u53ef\u89c6\u5316\u3002<\/li>\n<\/ul>\n<p><p>\u786e\u4fdd\u8fd9\u4e9b\u5e93\u7684\u7248\u672c\u4e0emlpy\u7684\u9700\u6c42\u5339\u914d\uff0c\u53ef\u4ee5\u901a\u8fc7\u9605\u8bfbmlpy\u7684\u6587\u6863\u6216\u76f8\u5173\u7684\u5b89\u88c5\u6307\u5357\u6765\u786e\u8ba4\u7248\u672c\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5b89\u88c5<\/h3>\n<\/p>\n<p><p>\u4e00\u65e6\u6240\u6709\u7684\u4f9d\u8d56\u5e93\u90fd\u51c6\u5907\u597d\u4e86\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u7684\u5305\u7ba1\u7406\u5de5\u5177\u6765\u5b89\u88c5mlpy\u3002\u867d\u7136mlpy\u53ef\u4ee5\u901a\u8fc7pip\u5b89\u88c5\uff0c\u4f46\u7531\u4e8e\u7248\u672c\u95ee\u9898\uff0c\u6709\u65f6\u9700\u8981\u4ece\u6e90\u4ee3\u7801\u7f16\u8bd1\u3002<\/p>\n<\/p>\n<ul>\n<li><strong>\u901a\u8fc7pip\u5b89\u88c5<\/strong>\uff1a\u5c1d\u8bd5\u4f7f\u7528<code>pip install mlpy<\/code>\u3002\u5982\u679cmlpy\u7684\u6700\u65b0\u7248\u672c\u5728PyPI\u4e0a\u53ef\u7528\uff0c\u5e76\u4e14\u4e0e\u4f60\u7684Python\u7248\u672c\u517c\u5bb9\uff0c\u8fd9\u662f\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u3002<\/li>\n<li><strong>\u4ece\u6e90\u4ee3\u7801\u5b89\u88c5<\/strong>\uff1a\u6709\u65f6\uff0c\u76f4\u63a5\u4ece\u6e90\u4ee3\u7801\u5b89\u88c5\u662f\u89e3\u51b3\u7248\u672c\u517c\u5bb9\u95ee\u9898\u7684\u552f\u4e00\u65b9\u6cd5\u3002\u53ef\u4ee5\u4ecemlpy\u7684GitHub\u9875\u9762\u4e0b\u8f7d\u6e90\u7801\uff0c\u7136\u540e\u5728\u6e90\u7801\u76ee\u5f55\u4e2d\u8fd0\u884c<code>python setup.py install<\/code>\u3002<\/li>\n<\/ul>\n<p><h3>\u56db\u3001\u89e3\u51b3\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u51fa\u73b0\u7684\u95ee\u9898<\/h3>\n<\/p>\n<p><p>\u5728\u5b89\u88c5mlpy\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898\uff0c\u6bd4\u5982\u4f9d\u8d56\u5e93\u7248\u672c\u4e0d\u517c\u5bb9\u3001\u7f16\u8bd1\u9519\u8bef\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u4f9d\u8d56\u5e93\u7248\u672c\u4e0d\u517c\u5bb9<\/strong>\uff1a\u5982\u679c\u51fa\u73b0\u4e0e\u7248\u672c\u76f8\u5173\u7684\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5b89\u88c5\u5e93\u7684\u65e7\u7248\u672c\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>pip install numpy==1.16.0<\/code>\u6765\u5b89\u88c5\u7279\u5b9a\u7248\u672c\u7684NumPy\u3002<\/li>\n<li><strong>\u7f16\u8bd1\u9519\u8bef<\/strong>\uff1a\u5728\u4ece\u6e90\u4ee3\u7801\u7f16\u8bd1\u5b89\u88c5\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u7f16\u8bd1\u5668\u9519\u8bef\u3002\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u4e0a\u5b89\u88c5\u4e86\u5408\u9002\u7684C\u7f16\u8bd1\u5668\uff0c\u6bd4\u5982GCC\u3002<\/li>\n<li><strong>\u64cd\u4f5c\u7cfb\u7edf\u7279\u5b9a\u95ee\u9898<\/strong>\uff1a\u5728Windows\u4e0a\uff0c\u5b89\u88c5\u53ef\u80fd\u4f1a\u66f4\u52a0\u590d\u6742\uff0c\u5efa\u8bae\u4f7f\u7528Windows Subsystem for Linux (WSL) \u6216\u8005\u5728Linux\u7cfb\u7edf\u4e0a\u8fdb\u884c\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u5e94\u8be5\u80fd\u591f\u6210\u529f\u5730\u5728\u4f60\u7684\u7cfb\u7edf\u4e0a\u5b89\u88c5mlpy\uff0c\u5e76\u5f00\u59cb\u4f7f\u7528\u5b83\u8fdb\u884c\u79d1\u5b66\u8ba1\u7b97\u548c\u673a\u5668\u5b66\u4e60\u4efb\u52a1\u3002\u5982\u679c\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9047\u5230\u5176\u4ed6\u95ee\u9898\uff0c\u5efa\u8bae\u67e5\u770bmlpy\u7684\u5b98\u65b9\u6587\u6863\u6216\u76f8\u5173\u7684\u793e\u533a\u652f\u6301\u6765\u5bfb\u627e\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u73af\u5883\u4e2d\u5b89\u88c5mlpy\uff1f<\/strong><br \/>\u8981\u5728Python\u73af\u5883\u4e2d\u5b89\u88c5mlpy\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528Python\u7684\u5305\u7ba1\u7406\u5de5\u5177pip\u3002\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a  <\/p>\n<pre><code class=\"language-bash\">pip install mlpy\n<\/code><\/pre>\n<p>\u786e\u4fdd\u60a8\u7684Python\u548cpip\u7248\u672c\u662f\u6700\u65b0\u7684\uff0c\u4ee5\u907f\u514d\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u7684\u517c\u5bb9\u6027\u95ee\u9898\u3002<\/p>\n<p><strong>mlpy\u9002\u7528\u4e8e\u54ea\u4e9bPython\u7248\u672c\uff1f<\/strong><br \/>mlpy\u4e3b\u8981\u652f\u6301Python 2.7\u548cPython 3.x\u7248\u672c\u3002\u4e3a\u4e86\u786e\u4fdd\u6700\u4f73\u517c\u5bb9\u6027\uff0c\u5efa\u8bae\u4f7f\u7528\u6700\u65b0\u7684Python\u7248\u672c\uff0c\u5e76\u5728\u5b89\u88c5\u524d\u68c0\u67e5mlpy\u7684\u5b98\u65b9\u6587\u6863\uff0c\u4ee5\u4e86\u89e3\u5177\u4f53\u7684\u7248\u672c\u8981\u6c42\u548c\u517c\u5bb9\u6027\u3002<\/p>\n<p><strong>\u5b89\u88c5mlpy\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\u5728Python\u4ea4\u4e92\u5f0f\u547d\u4ee4\u884c\u6216\u811a\u672c\u4e2d\u5bfc\u5165mlpy\u6765\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002\u8fd0\u884c\u4ee5\u4e0b\u4ee3\u7801\uff1a  <\/p>\n<pre><code class=\"language-python\">import mlpy\nprint(mlpy.__version__)\n<\/code><\/pre>\n<p>\u5982\u679c\u6ca1\u6709\u9519\u8bef\u6d88\u606f\u5e76\u4e14\u6210\u529f\u6253\u5370\u51fa\u7248\u672c\u53f7\uff0c\u8bf4\u660emlpy\u5df2\u6210\u529f\u5b89\u88c5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5b89\u88c5mlpy\u7684\u6b65\u9aa4\u5305\u62ec\uff1a\u786e\u4fddPython\u7248\u672c\u517c\u5bb9\u3001\u5b89\u88c5\u4f9d\u8d56\u5e93\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5b89\u88c5\u3001\u89e3\u51b3\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u51fa\u73b0\u7684\u95ee\u9898 [&hellip;]","protected":false},"author":3,"featured_media":932890,"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\/932885"}],"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=932885"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/932885\/revisions"}],"predecessor-version":[{"id":932891,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/932885\/revisions\/932891"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/932890"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=932885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=932885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=932885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}