{"id":1281,"date":"2025-09-22T15:16:44","date_gmt":"2025-09-22T07:16:44","guid":{"rendered":"https:\/\/www.jchj.top\/?p=1281"},"modified":"2025-10-11T10:08:06","modified_gmt":"2025-10-11T02:08:06","slug":"python3-10-10%e7%bc%96%e8%af%91%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/www.jchj.top\/?p=1281","title":{"rendered":"python3.10.10\u7f16\u8bd1\u5b89\u88c5"},"content":{"rendered":"\n<p>1 \u5b89\u88c5\u7f16\u8bd1\u6240\u9700\u7684\u4f9d\u8d56<\/p>\n\n\n\n<p>[root@localhost ~]# yum -y update<\/p>\n\n\n\n<p>[root@localhost ~]# yum -y install openssl-devel libffi-devel bzip2-devel<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"796\" src=\"https:\/\/www.jchj.top\/wp-content\/uploads\/2025\/10\/1280X1280-5.png\" alt=\"\" class=\"wp-image-1507\"\/><\/figure>\n\n\n\n<p>[root@localhost ~]# yum -y groupinstall &#8220;Development Tools&#8221;<\/p>\n\n\n\n<p>[root@localhost ~]# yum install -y ncurses-devel gdbm-devel xz-devel sqlite-devel tk-devel uuid-devel readline-devel bzip2-devel libffi-devel<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"907\" src=\"https:\/\/www.jchj.top\/wp-content\/uploads\/2025\/10\/1280X1280-1-1.png\" alt=\"\" class=\"wp-image-1505\"\/><\/figure>\n\n\n\n<p><strong>\u6ce8\u610f\uff1a\u5148\u5347\u7ea7CentOS7\u5347\u7ea7OpenSSL<\/strong><\/p>\n\n\n\n<p>\u539f\u56e0\uff1aCentOS7\u7684yum\u4ed3\u5e93\u4e2d\uff0cOpenSSL\u7684\u7248\u672c\u4e3aOpenSSL 1.0.2k-fips\uff0c\u6bd4\u8f83\u65e7\uff0c\u5728\u540e\u7eed\u5b89\u88c5\u67d0\u4e9b\u8f6f\u4ef6\u65f6\uff08\u5982Python3.10\uff09\uff0c\u8981\u6c42\u66f4\u9ad8\u7248\u672c\u7684OpenSSL\uff0c\u73b0\u5728\u6211\u4eec\u6765\u624b\u52a8\u5347\u7ea7OpenSSL\u3002<\/p>\n\n\n\n<p>\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684\u6e90\u7801\u5305\uff1a[root@localhost ~]# wget https:\/\/www.openssl.org\/source\/openssl-1.1.1q.tar.gz &#8211;no-check-certificate<\/p>\n\n\n\n<p>\u89e3\u538b\u7f29\u5e76\u8fdb\u5165\u76ee\u5f55\uff1a <\/p>\n\n\n\n<p>[root@localhost ~]# tar zxf openssl-1.1.1q.tar.gz <\/p>\n\n\n\n<p>[root@localhost ~]# cd openssl-1.1.1q <\/p>\n\n\n\n<p>[root@localhost ~]# .\/config &#8211;prefix=\/usr\/local\/openssl-1.1.1 <\/p>\n\n\n\n<p>[root@localhost ~]# make &amp;&amp; make install<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"865\" src=\"https:\/\/www.jchj.top\/wp-content\/uploads\/2025\/10\/1280X1280-2-1.png\" alt=\"\" class=\"wp-image-1506\"\/><\/figure>\n\n\n\n<p>2 \u4e0b\u8f7d\u6e90\u4ee3\u7801 Python \u5b98\u65b9\u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/www.python.org\/downloads\/ \u6216\u4f7f\u7528wget\u4e0b\u8f7d<\/p>\n\n\n\n<p>\u6682\u65f6\u65e0\u6cd5\u5728\u98de\u4e66\u6587\u6863\u5916\u5c55\u793a\u6b64\u5185\u5bb9<\/p>\n\n\n\n<p>\u6253\u5f00\u94fe\u63a5\uff0c\u53ef\u4ee5\u770b\u5230\u5404\u4e2a\u7248\u672c\u7684 Python\uff1a<\/p>\n\n\n\n<p>\u5728\u201cGzipped source tarball\u201d\u5904\u5355\u51fb\u9f20\u6807\u53f3\u952e\uff0c\u4ece\u5f39\u51fa\u83dc\u5355\u4e2d\u9009\u62e9\u201c\u590d\u5236\u94fe\u63a5\u5730\u5740\u201d\uff0c\u5373\u53ef\u5f97\u5230.tgz\u683c\u5f0f\u7684\u6e90\u7801\u538b\u7f29\u5305\u5730\u5740\u3002 \u5982\u4e0b\u6267\u884c\u547d\u4ee4\uff1a [root@localhost ~]# wget https:\/\/www.python.org\/ftp\/python\/3.10.10\/Python-3.10.10.tgz \u89e3\u538b\u6e90\u7801\u5305\uff1a [root@localhost ~]# tar -zxvf Python-3.10.10.tgz<\/p>\n\n\n\n<p>3 \u7f16\u8bd1 \u4f7f\u7528 make \u5de5\u5177\u8fdb\u884c\u7f16\u8bd1\uff1a [root@localhost ~]# .\/configure &#8211;enable-optimizations &#8211;with-openssl=\/usr\/local\/openssl-1.1.1 &#8211;with-openssl-rpath=auto<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"876\" src=\"https:\/\/www.jchj.top\/wp-content\/uploads\/2025\/10\/f8c0f4ab-be26-413e-8629-cc59e371c72f.png\" alt=\"\" class=\"wp-image-1510\"\/><\/figure>\n\n\n\n<p>[root@localhost ~]# make &amp;&amp; make install<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"819\" src=\"https:\/\/www.jchj.top\/wp-content\/uploads\/2025\/10\/bae2d47d-31d2-49dd-b078-b93f01ff3c77.png\" alt=\"\" class=\"wp-image-1508\"\/><\/figure>\n\n\n\n<p><strong>[root@<\/strong><strong>localhost<\/strong><strong> ~]# make &amp;&amp; make install (\u7f16\u8bd1\u5b89\u88c5\u62a5\u9519\uff09<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"573\" src=\"https:\/\/www.jchj.top\/wp-content\/uploads\/2025\/10\/cbbfec61-a6db-4f12-92fc-1aec1407fe10.png\" alt=\"\" class=\"wp-image-1509\"\/><\/figure>\n\n\n\n<p>\u5bfc\u81f4\u539f\u56e0<\/p>\n\n\n\n<p>\u5728\u4f4e\u7248\u672c\u7684gcc\u7248\u672c\uff0c\u4f7f\u7528 gcc \u547d\u4ee4\u5e76\u5e26\u6709 &#8211;enable-optimizations \u53c2\u6570\u65f6\u4f1a\u51fa\u73b0\u4e0a\u9762\u95ee\u9898\u3002\u5728 gcc 8.1.0 \u6b64\u95ee\u9898\u5df2\u7ecf\u4fee\u590d\u3002<\/p>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5<\/p>\n\n\n\n<p>1\u3001\u5347\u7ea7gcc\u81f3 8.1.0\uff0c\u4e0d\u662f\u5f88\u63a8\u8350\uff0c\u53ef\u80fd\u4f1a\u5f71\u54cd\u5176\u4ed6\u8f6f\u4ef6\u7684\u7f16\u8bd1\u3002<\/p>\n\n\n\n<p>2\u3001.\/configure\u53c2\u6570\u4e2d\u53bb\u6389 &#8211;enable-optimizations\u3002\u7136\u540e\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n\n\n\n<p>[root@localhost ~]#.\/configure &#8211;with-openssl=\/usr\/local\/openssl-1.1.1 &#8211;with-openssl-rpath=auto<\/p>\n\n\n\n<p>\u8fd9\u91cc\u7684&#8211;prefix=\/usr\/local\u7528\u4e8e\u6307\u5b9a\u5b89\u88c5\u76ee\u5f55\uff08\u5efa\u8bae\u6307\u5b9a\uff09\u3002\u5982\u679c\u4e0d\u6307\u5b9a\uff0c\u5c31\u4f1a\u4f7f\u7528\u9ed8\u8ba4\u7684\u5b89\u88c5\u76ee\u5f55\u3002<\/p>\n\n\n\n<p>[root@localhost ~]# make &amp;&amp; make install<\/p>\n\n\n\n<p>[root@localhost Python-3.10.10]# python3 \u5b89\u88c5\u6210\u529f<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"361\" src=\"https:\/\/www.jchj.top\/wp-content\/uploads\/2025\/10\/fde1ee0f-5665-4b91-88d7-ada478374455.png\" alt=\"\" class=\"wp-image-1511\"\/><\/figure>\n\n\n\n<p>python\u547d\u4ee4\u9ed8\u8ba4\u8c03\u7528\u7684\u662f Python 2.x \u5f00\u53d1\u73af\u5883\uff0c\u5982\u679c\u4f60\u4e60\u60ef\u4f7f\u7528 Python 3.x\uff0c\u611f\u89c9\u6bcf\u6b21\u8f93\u5165python3\u547d\u4ee4\u6709\u70b9\u9ebb\u70e6\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u4fee\u6539\u914d\u7f6e\uff0c\u8ba9python\u547d\u4ee4\u8f6c\u800c\u8c03\u7528 Python 3.x \u5f00\u53d1\u73af\u5883\u3002\u5177\u4f53\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>[root@localhost ~]# unlink \/usr\/bin\/python<\/p>\n\n\n\n<p>[root@localhost ~]# ln -s \/usr\/local\/bin\/python3.10 \/usr\/bin\/python<\/p>\n\n\n\n<p>\u4e0a\u8ff0\u547d\u4ee4\u6267\u884c\u5b8c\u6210\u4ee5\u540e\uff0c\u518d\u6b21\u5728\u7ec8\u7aef\u8f93\u5165python\u547d\u4ee4\uff0c\u8fdb\u5165\u7684\u5c31\u662f Python 3.8 \u7684\u4ea4\u4e92\u5f0f\u5f00\u53d1\u73af\u5883\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"98\" src=\"https:\/\/www.jchj.top\/wp-content\/uploads\/2025\/10\/41bfacbb-009d-4850-bbe6-cf76be042ff4.png\" alt=\"\" class=\"wp-image-1504\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>1 \u5b89\u88c5\u7f16\u8bd1\u6240\u9700\u7684\u4f9d\u8d56 [root@localho&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,1],"tags":[],"class_list":["post-1281","post","type-post","status-publish","format-standard","hentry","category-linux","category-1"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.jchj.top\/index.php?rest_route=\/wp\/v2\/posts\/1281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jchj.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jchj.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jchj.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jchj.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1281"}],"version-history":[{"count":6,"href":"https:\/\/www.jchj.top\/index.php?rest_route=\/wp\/v2\/posts\/1281\/revisions"}],"predecessor-version":[{"id":1513,"href":"https:\/\/www.jchj.top\/index.php?rest_route=\/wp\/v2\/posts\/1281\/revisions\/1513"}],"wp:attachment":[{"href":"https:\/\/www.jchj.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jchj.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jchj.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}