{"id":205281,"date":"2025-05-29T17:11:28","date_gmt":"2025-05-29T09:11:28","guid":{"rendered":"https:\/\/server.hk\/cnblog\/205281\/"},"modified":"2025-05-29T17:11:28","modified_gmt":"2025-05-29T09:11:28","slug":"%e5%9c%a8%e5%ae%89%e8%a3%85-python-%e6%97%b6%e9%81%87%e5%88%b0gcc-error-directory-no-such-file-or-directory%e9%94%99%e8%af%af%e6%80%8e%e4%b9%88%e5%8a%9e%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/205281\/","title":{"rendered":"\u5728\u5b89\u88c5 Python \u65f6\u9047\u5230\u201cgcc: error: directory: No such file or directory\u201d\u9519\u8bef\u600e\u4e48\u529e\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5728\u5b89\u88c5 Python \u65f6\u9047\u5230\u201cgcc: error: directory: No such file or directory\u201d\u9519\u8bef\u600e\u4e48\u529e\uff1f<\/h1>\n<p>\u5c0f\u4f19\u4f34\u4eec\u5bf9\u6587\u7ae0\u7f16\u7a0b\u611f\u5174\u8da3\u5417\uff1f\u662f\u5426\u6b63\u5728\u5b66\u4e60\u76f8\u5173\u77e5\u8bc6\u70b9\uff1f\u5982\u679c\u662f\uff0c\u90a3\u4e48\u672c\u6587\u300a\u5728\u5b89\u88c5 Python \u65f6\u9047\u5230\u201cgcc: error: directory: No such file or directory\u201d\u9519\u8bef\u600e\u4e48\u529e\uff1f\u300b\uff0c\u5c31\u5f88\u9002\u5408\u4f60\uff0c\u672c\u7bc7\u6587\u7ae0\u8bb2\u89e3\u7684\u77e5\u8bc6\u70b9\u4e3b\u8981\u5305\u62ec\u3002\u5728\u4e4b\u540e\u7684\u6587\u7ae0\u4e2d\u4e5f\u4f1a\u591a\u591a\u5206\u4eab\u76f8\u5173\u77e5\u8bc6\u70b9\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241128\/17327563626747c38a7a166.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>gcc \u751f\u6210\u201cdirectory\u201d: \u65e0\u6b64\u6587\u4ef6\u6216\u76ee\u5f55\u9519\u8bef<\/strong><\/p>\n<p>\u5728\u5b89\u88c5 python \u65f6\uff0c\u6267\u884c make \u547d\u4ee4\u53ef\u80fd\u4f1a\u9047\u5230\u5982\u4e0b\u9519\u8bef\uff1a<\/p>\n<pre>gcc: error: directory\": No such file or directory<\/pre>\n<p><strong>\u539f\u56e0\u5206\u6790<\/strong><\/p>\n<p>\u6b64\u9519\u8bef\u8868\u660e gcc \u65e0\u6cd5\u627e\u5230\u5b83\u5df2\u6307\u5b9a\u8981\u5305\u542b\u7684\u76ee\u5f55\u3002\u76ee\u5f55\u53ef\u80fd\u662f\u60a8\u6b63\u5728\u6784\u5efa\u7684\u6e90\u4ee3\u7801\u6216\u7a0b\u5e8f\u6240\u9700\u7684\u5e93\u3001\u5934\u6587\u4ef6\u6216\u5176\u4ed6\u8d44\u6e90\u3002<\/p>\n<p><strong>\u53ef\u80fd\u7684\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p><strong>\u68c0\u67e5\u76ee\u5f55\u8def\u5f84<\/strong><\/p>\n<p>\u786e\u4fdd\u76ee\u5f55\u8def\u5f84\u6b63\u786e\u65e0\u8bef\u3002\u68c0\u67e5 .\/include \u548c .\/include \u662f\u5426\u5b58\u5728\u4e8e\u6b63\u786e\u7684\u76ee\u5f55\u4e2d\u3002<\/p>\n<p><strong>\u5b89\u88c5\u4f9d\u8d56\u9879<\/strong><\/p>\n<p>\u786e\u4fdd\u5df2\u5b89\u88c5\u6240\u6709\u5fc5\u9700\u7684\u4f9d\u8d56\u9879\u3002\u5177\u4f53\u4f9d\u8d56\u9879\u53d6\u51b3\u4e8e\u60a8\u8981\u6784\u5efa\u7684 python \u7248\u672c\u548c\u64cd\u4f5c\u7cfb\u7edf\u3002<\/p>\n<p><strong>\u5728\u6ca1\u6709\u5305\u88c5\u7ba1\u7406\u5668\u7684\u60c5\u51b5\u4e0b\u7f16\u8bd1 python<\/strong><\/p>\n<p>\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u8f83\u65e7\u7684\u53d1\u884c\u7248\u6216\u672a\u4e3a\u81ea\u5b9a\u4e49\u914d\u7f6e\u542f\u7528\u5305\u88c5\u7ba1\u7406\u5668\uff0c\u5219\u9700\u8981\u624b\u52a8\u7f16\u8bd1 python\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b8c\u6210\uff1a<\/p>\n<ol>\n<li>\u4ece python \u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u6e90\u4ee3\u7801\u3002<\/li>\n<li>\u89e3\u538b\u6e90\u4ee3\u7801\u5305\u5230\u4e00\u4e2a\u76ee\u5f55\u4e2d\u3002<\/li>\n<li>\u5207\u6362\u5230\u5305\u542b python \u6e90\u4ee3\u7801\u7684\u76ee\u5f55\u3002<\/li>\n<li>\u8fd0\u884c .\/configure \u4ee5\u914d\u7f6e\u6784\u5efa\u3002<\/li>\n<li>\u8fd0\u884c make \u4ee5\u7f16\u8bd1 python\u3002<\/li>\n<li>\u8fd0\u884c make install \u4ee5\u5b89\u88c5 python\u3002<\/li>\n<\/ol>\n<p><strong>\u6539\u7528\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668<\/strong><\/p>\n<p>\u5bf9\u4e8e\u5927\u591a\u6570\u73b0\u4ee3 linux \u53d1\u884c\u7248\uff0c\u5f3a\u70c8\u5efa\u8bae\u4f7f\u7528\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u6765\u5b89\u88c5 python\uff0c\u56e0\u4e3a\u5b83\u65b9\u4fbf\u3001\u9ad8\u6548\u4e14\u53ef\u786e\u4fdd\u5b89\u88c5\u6b63\u786e\u3002\u8981\u901a\u8fc7\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u5b89\u88c5 python\uff0c\u8bf7\u4f7f\u7528\u76f8\u5e94\u7684\u547d\u4ee4\uff1a<\/p>\n<ul>\n<li><strong>debian\/ubuntu\uff1a<\/strong> sudo apt-get install python3<\/li>\n<li><strong>fedora\/red hat\uff1a<\/strong> sudo yum install python3<\/li>\n<li><strong>arch linux\uff1a<\/strong> sudo pacman -s python<\/li>\n<\/ul>\n<p>\u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300a\u5728\u5b89\u88c5 Python \u65f6\u9047\u5230\u201cgcc: error: directory: No such file or directory\u201d\u9519\u8bef\u600e\u4e48\u529e\uff1f\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5b89\u88c5 Python \u65f6\u9047\u5230\u201cg&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-205281","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/205281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=205281"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/205281\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=205281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=205281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=205281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}