{"id":134564,"date":"2020-07-08T14:30:54","date_gmt":"2020-07-08T06:30:54","guid":{"rendered":"http:\/\/4563.org\/?p=134564"},"modified":"2020-07-08T14:30:54","modified_gmt":"2020-07-08T06:30:54","slug":"macos-%e4%b8%ad%e7%9a%84-python-%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=134564","title":{"rendered":"macOS \u4e2d\u7684 Python \u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  macOS \u4e2d\u7684 Python \u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : azev <\/span>  <span><i><\/i> 19<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u8d77\u5148\u7cfb\u7edf\u53ea\u6709 python2\uff0c\u4f46\u6ca1\u6709 pip \u3002<br \/> \u88c5\u5b8c xcode \u540e\u53d1\u73b0\u6709\u4e86 python3 \u548c pip3<br \/> \u4e8e\u662f\u6211\u5c31\u6267\u884c\u4e86\u4e00\u53e5 pip3 install requests<br \/> \u7ed3\u679c\u63d0\u793a<br \/> Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: &#8216;\/Library\/Python\/3.7&#8217;<\/p>\n<p>\u6211\u770b \/Library\/Python\/\u4e0b\u5e76\u6ca1\u6709 3.7 \u8fd9\u4e2a\u76ee\u5f55<br \/> \u6309\u6211\u7406\u89e3\u5e94\u8be5\u662f\u5f80\u4e0b\u9762\u8fd9\u4e2a\u8def\u5f84\u5b89\u88c5\u554a<br \/> \/Applications\/Xcode.app\/Contents\/Developer\/Library\/Frameworks\/Python3.framework\/Versions\/3.7\/lib\/python3.7\/site-packages\/<\/p>\n<p>\u592a\u5947\u602a\u4e86\uff1f\u4e3a\u4ec0\u4e48\u4e0d\u5f80\u4e0a\u9762\u90a3\u4e2a\u76ee\u5f55\u5b89\u88c5 \u800c\u662f\u5f80 \/Library\/Python\/3.7 \u5b89\u88c5\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>7<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2403724\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zachlhb <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528 conda \u5427\uff0c\u7c7b unix \u7cfb\u7edf\u7684\u81ea\u5e26 Python \u90fd\u5f88\u86cb\u75bc                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2403725\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lxk11153 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &#8220;\u800c\u662f\u5f80 \/Library\/Python\/3.7 \u5b89\u88c5&#8221; \u5e94\u8be5\u662f\u7528\u6765\u5171\u4eab packages                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2403726\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : liprais <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u522b\u7528\u7cfb\u7edf\u81ea\u5e26\u7684 python<br \/>pyenv,conda \u88c5\u4e00\u4e2a\u7528                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2403727\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Takizawa <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0b\u4e2a annconda.pgk \u89e3\u541b\u6101\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2403728\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lululau <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Xcode \u76ee\u5f55\u4e0b\u9762\u4f60\u4e0d\u52a0 sudo \u4e5f\u4e0d\u884c\u554a<\/p>\n<p>\u52a0 sudo \u6216\u8005 &#8211;user \u5b89\u88c5\u5230\u7528\u6237\u76ee\u5f55<\/p>\n<p>\u522b\u542c\u4ed6\u4eec\u7684\uff0cMac \u7684 SSD \u5f88\u8d35\u7684\uff0c\u7528 pyenv \u4e5f\u53ef\u4ee5 mount \u7cfb\u7edf\u7684 Python\uff0c\u53c2\u8003\uff1a https:\/\/www.v2ex.com\/t\/494225#reply2                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2403729\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : julyclyde <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             python3 \u5e94\u8be5\u662f\u7cfb\u7edf\u81ea\u5e26\u7684\u5427\uff0c\u4e0d\u662f xcode \u7684\u5427\uff1f<\/p>\n<p>\u4f4e\u7248\u672c pip \u9ed8\u8ba4\u884c\u4e3a&#8211;system \uff1b\u65b0\u7248\u672c\u4f1a fallback \u5230&#8211;user                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2403730\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ysc3839 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ef\u80fd\u662f\u56e0\u4e3a macOS \u7684\u5e94\u7528\u7b7e\u540d\u7b56\u7565\u4e0d\u5141\u8bb8\u4fee\u6539 .app \u6587\u4ef6\u5939\u7684\u5185\u5bb9\uff1f\u4ee5\u524d\u597d\u50cf\u6709\u4e86\u89e3\u8fc7\u80fd\u4e0d\u80fd\u628a\u6570\u636e\u5b58\u653e\u5728 .app \u91cc\u9762\uff0c\u6216\u8005\u53ea\u5bf9\u90e8\u5206\u6587\u4ef6\u8fdb\u884c\u66f4\u65b0\uff0c\u7ed3\u8bba\u90fd\u662f\u4e0d\u4e0d\u53ef\u4ee5\uff0c\u53ea\u8981\u591a\u4e86\u6216\u8005\u5c11\u4e86\u6587\u4ef6\u5c31\u7b97\u7b7e\u540d\u65e0\u6548\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>macOS \u4e2d\u7684 Python \u95ee&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/134564"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=134564"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/134564\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=134564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=134564"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=134564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}