{"id":50621,"date":"2024-12-03T17:33:37","date_gmt":"2024-12-03T09:33:37","guid":{"rendered":"https:\/\/fwq.ai\/blog\/50621\/"},"modified":"2024-12-03T17:33:37","modified_gmt":"2024-12-03T09:33:37","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-python-%e5%88%a4%e6%96%ad-mac-%e6%98%af-m1-%e8%bf%98%e6%98%af-intel-%e6%9e%b6%e6%9e%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/50621\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 Python \u5224\u65ad Mac \u662f M1 \u8fd8\u662f Intel \u67b6\u6784\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u4f7f\u7528 Python \u5224\u65ad Mac \u662f M1 \u8fd8\u662f Intel \u67b6\u6784\uff1f<\/h1>\n<p>\u5728\u6587\u7ae0\u5b9e\u6218\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u9047\u5230\u4e00\u4e9b\u8fd9\u6837\u90a3\u6837\u7684\u95ee\u9898\uff0c\u7136\u540e\u8981\u5361\u597d\u534a\u5929\uff0c\u7b49\u95ee\u9898\u89e3\u51b3\u4e86\u624d\u53d1\u73b0\u539f\u6765\u4e00\u4e9b\u7ec6\u8282\u77e5\u8bc6\u70b9\u8fd8\u662f\u6ca1\u6709\u638c\u63e1\u597d\u3002\u4eca\u5929\u7c73\u4e91\u5c31\u6574\u7406\u5206\u4eab\u300a\u5982\u4f55\u4f7f\u7528 Python \u5224\u65ad Mac \u662f M1 \u8fd8\u662f Intel \u67b6\u6784\uff1f\u300b\uff0c\u804a\u804a\uff0c\u5e0c\u671b\u53ef\u4ee5\u5e2e\u52a9\u5230\u6b63\u5728\u52aa\u529b\u8d5a\u94b1\u7684\u4f60\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241124\/17324134706742881e0f451.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 Python \u5224\u65ad Mac \u662f M1 \u8fd8\u662f Intel \u67b6\u6784\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 Python \u5224\u65ad Mac \u662f M1 \u8fd8\u662f Intel \u67b6\u6784\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>python \u8bc6\u522b mac m1 \u6216 intel \u67b6\u6784<\/strong><\/p>\n<p>\u8981\u5224\u65ad mac \u7684\u67b6\u6784\uff0c\u65e2\u53ef\u4ee5\u662f intel \u4e5f\u53ef\u80fd\u662f m1\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\uff1a<\/p>\n<p><strong>\u4f7f\u7528 cpuinfo<\/strong><\/p>\n<p>\u8fd9\u662f\u8bc6\u522b mac \u67b6\u6784\u7684\u63a8\u8350\u65b9\u6cd5\uff1a<\/p>\n<pre>pip install py-cpuinfo<\/pre>\n<pre>import cpuinfo\n\nbrand = cpuinfo.get_cpu_info().get('brand_raw')\n\nprint(brand)\n\ncpuinfo.get_cpu_info_json()<\/pre>\n<p>\u8f93\u51fa\u7ed3\u679c\u5c06\u663e\u793a\u5904\u7406\u5668\u54c1\u724c\uff0c\u5982\u679c\u662f &#8220;apple m1&#8243;\uff0c\u5219\u8868\u660e mac \u662f m1 \u67b6\u6784\uff1b\u5982\u679c\u662f\u5176\u4ed6\u540d\u79f0\uff0c\u5219\u8868\u660e mac \u662f intel \u67b6\u6784\u3002<\/p>\n<p>\u76f8\u6bd4\u4e4b\u4e0b\uff0c\u4f7f\u7528 sysctl \u6216 system_profiler \u7b49\u5176\u4ed6\u65b9\u6cd5\u53ef\u80fd\u4f1a\u4ea7\u751f\u4e0d\u51c6\u786e\u7684\u7ed3\u679c\uff0c\u56e0\u6b64\u5efa\u8bae\u4f7f\u7528 cpuinfo \u6765\u83b7\u53d6\u53ef\u200b\u200b\u9760\u7684\u4fe1\u606f\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u300a\u5982\u4f55\u4f7f\u7528 Python \u5224\u65ad Mac \u662f M1 \u8fd8\u662f Intel \u67b6\u6784\uff1f\u300b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u5173\u4e8e\u7684\u8d44\u6599\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528 Python \u5224\u65ad Mac \u662f M1 \u8fd8\u662f Intel \u67b6\u6784\uff1f \u5728\u6587\u7ae0\u5b9e\u6218\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u9047\u5230\u4e00\u4e9b\u8fd9\u6837\u90a3\u6837\u7684\u95ee\u9898\uff0c\u7136\u540e\u8981\u5361\u597d\u534a\u5929\uff0c\u7b49\u95ee\u9898\u89e3\u51b3\u4e86\u624d\u53d1\u73b0\u539f\u6765\u4e00\u4e9b\u7ec6\u8282\u77e5\u8bc6\u70b9\u8fd8\u662f\u6ca1\u6709\u638c\u63e1\u597d\u3002\u4eca\u5929\u7c73\u4e91\u5c31\u6574\u7406\u5206\u4eab\u300a\u5982\u4f55\u4f7f\u7528 Python \u5224\u65ad Mac \u662f M1 \u8fd8\u662f Intel \u67b6\u6784\uff1f\u300b\uff0c\u804a\u804a\uff0c\u5e0c\u671b\u53ef\u4ee5\u5e2e\u52a9\u5230\u6b63\u5728\u52aa\u529b\u8d5a\u94b1\u7684\u4f60\u3002 python \u8bc6\u522b mac m1 \u6216 intel \u67b6\u6784 \u8981\u5224\u65ad mac \u7684\u67b6\u6784\uff0c\u65e2\u53ef\u4ee5\u662f intel \u4e5f\u53ef\u80fd\u662f m1\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\uff1a \u4f7f\u7528 cpuinfo \u8fd9\u662f\u8bc6\u522b mac \u67b6\u6784\u7684\u63a8\u8350\u65b9\u6cd5\uff1a pip install py-cpuinfo import cpuinfo brand = cpuinfo.get_cpu_info().get(&#8216;brand_raw&#8217;) print(brand) cpuinfo.get_cpu_info_json() \u8f93\u51fa\u7ed3\u679c\u5c06\u663e\u793a\u5904\u7406\u5668\u54c1\u724c\uff0c\u5982\u679c\u662f &#8220;apple m1&#8243;\uff0c\u5219\u8868\u660e mac \u662f m1 \u67b6\u6784\uff1b\u5982\u679c\u662f\u5176\u4ed6\u540d\u79f0\uff0c\u5219\u8868\u660e mac \u662f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-50621","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/50621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=50621"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/50621\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=50621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=50621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=50621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}