{"id":699,"date":"2024-11-21T15:44:03","date_gmt":"2024-11-21T07:44:03","guid":{"rendered":"https:\/\/wangliguang.cn\/?p=699"},"modified":"2025-12-13T17:14:34","modified_gmt":"2025-12-13T09:14:34","slug":"%e3%80%90%e6%8e%92%e9%94%99%e6%95%99%e7%a8%8b%e3%80%91%e8%a7%a3%e5%86%b3youre-trying-to-build-pytorch-with-a-too-old-version-of-gcc-we-need-gcc-or-later-%e8%a7%a3%e5%86%b3%e6%b2%a1%e6%9c%89root","status":"publish","type":"post","link":"https:\/\/wangliguang.cn\/?p=699","title":{"rendered":"\u3010\u6392\u9519\u6559\u7a0b\u3011\u89e3\u51b3You&#8217;re trying to build PyTorch with a too old version of GCC. We need GCC  or later.\u89e3\u51b3\u6ca1\u6709root\u6743\u9650\u5b89\u88c5gcc\u548cg++\u95ee\u9898"},"content":{"rendered":"<h2>0 \u95ee\u9898\u63cf\u8ff0<\/h2>\n<p>\u5728\u4f7f\u7528<code>pip install -e . --no-build-isolation -i https:\/\/mirrors.tuna.tsinghua.edu.cn\/pypi\/web\/simple<\/code>\u5b89\u88c5\u548c\u7f16\u8bd1\u5305\u65f6\uff0c\u62a5<code>You&#039;re trying to build PyTorch with a too old version of GCC. We need GCC  or later.<\/code>\u95ee\u9898\uff0c\u540c\u65f6\u65e0\u6743\u9650\u5b89\u88c5GCC\u548cG++<\/p>\n<h2>1 \u89e3\u51b3\u65b9\u6848<\/h2>\n<h3>1.1 \u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/h3>\n<p><code>conda activate {myenv}<\/code><\/p>\n<h3>1.2 \u5b89\u88c5<code>cxx-compiler<\/code><\/h3>\n<p>\u5728\u5b89\u88c5\u524d\uff0c\u53ef\u4ee5\u5148\u4f7f\u7528<br \/>\n<code>conda search cxx-compiler -c conda-forge<\/code>\u67e5\u627e\u81ea\u5df1\u60f3\u8981\u7684\u7248\u672c\u3002<br \/>\n\u7136\u540e\u4f7f\u7528\u547d\u4ee4<code>conda install -c conda-forge cxx-compiler<\/code>\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<h3>1.3 \u4fee\u6539\u73af\u5883\u53d8\u91cf<\/h3>\n<pre><code>export PATH=\/{PATH_TO_YOUR_ENV}\/bin\/:$PATH\nexport PATH=\/{PATH_TO_YOUR_ENV}\/lib\/:$PATH<\/code><\/pre>\n<h3>1.4 \u67e5\u770bgcc\u7248\u672c<\/h3>\n<p>\u4f7f\u7528<code>gcc -v<\/code>\u5373\u53ef\u67e5\u770b\u7248\u672c\u3002<\/p>\n<h2>2 \u53c2\u8003\u8d44\u6599<\/h2>\n<p><a href=\"https:\/\/blog.csdn.net\/qq_43481884\/article\/details\/135916205\">https:\/\/blog.csdn.net\/qq_43481884\/article\/details\/135916205<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>0 \u95ee\u9898\u63cf\u8ff0 \u5728\u4f7f\u7528pip install -e . &#8211;no-build-isolation -i http&hellip; <a href=\"https:\/\/wangliguang.cn\/?p=699\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">\u3010\u6392\u9519\u6559\u7a0b\u3011\u89e3\u51b3You&#8217;re trying to build PyTorch with a too old version of GCC. We need GCC  or later.\u89e3\u51b3\u6ca1\u6709root\u6743\u9650\u5b89\u88c5gcc\u548cg++\u95ee\u9898<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-699","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wangliguang.cn\/index.php?rest_route=\/wp\/v2\/posts\/699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wangliguang.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wangliguang.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wangliguang.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wangliguang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=699"}],"version-history":[{"count":1,"href":"https:\/\/wangliguang.cn\/index.php?rest_route=\/wp\/v2\/posts\/699\/revisions"}],"predecessor-version":[{"id":700,"href":"https:\/\/wangliguang.cn\/index.php?rest_route=\/wp\/v2\/posts\/699\/revisions\/700"}],"wp:attachment":[{"href":"https:\/\/wangliguang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wangliguang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wangliguang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}