{"id":103,"date":"2023-02-03T11:41:52","date_gmt":"2023-02-03T03:41:52","guid":{"rendered":"http:\/\/39.104.58.144\/?p=103"},"modified":"2024-09-12T16:52:08","modified_gmt":"2024-09-12T08:52:08","slug":"python-3-11-1","status":"publish","type":"post","link":"http:\/\/www.algmain.com\/index.php\/2023\/02\/03\/python-3-11-1\/","title":{"rendered":"\u5347\u7ea7\u81f3Python-3.11.1"},"content":{"rendered":"\n<p>Python\u811a\u672c\u4ece2.x\u7248\u672c\u52303.x\u7248\u672c\u6709\u6bd4\u8f83\u5927\u7684\u66f4\u6539\u3002\u4e3a\u4e86\u4fdd\u8bc1\u7cfb\u7edf\u7684\u517c\u5bb9\u6027\uff0c\u539f\u6709\u7684Python 2.x\u811a\u672c\u73af\u5883\u5e94\u4e88\u4ee5\u4fdd\u7559\u3002<\/p>\n\n\n\n<p>\u9996\u5148<a href=\"https:\/\/www.python.org\/ftp\/python\/3.11.1\/Python-3.11.1.tgz\">\u4e0b\u8f7dpython-3.11.1<\/a>\u6570\u636e\u5305\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#cd \/usr\/local\/src\n......\n#wget https:\/\/www.python.org\/ftp\/python\/3.11.1\/Python-3.11.1.tgz\n......\n<\/pre><\/div>\n\n\n<p>\u89e3\u538b\u7f29\u6570\u636e\u5305\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#tar -xvf Python-3.11.1.tgz\n......\n<\/pre><\/div>\n\n\n<p>\u8bbe\u7f6e\u7f16\u8bd1\u73af\u5883\u548c\u9009\u9879\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#cd Python-3.11.1\n......\n#.configure --prefix=\/usr\/local\/python3\n......\n<\/pre><\/div>\n\n\n<p><em>\u6ce8\u610f\uff1a\u8fd9\u91cc\u901a\u8fc7\u8bbe\u7f6eprefix\u9879\u76ee\uff0c\u914d\u7f6e\u5b89\u88c5\u76ee\u5f55\u3002<\/em><\/p>\n\n\n\n<p>\u5f00\u59cb\u7f16\u8bd1\u548c\u5b89\u88c5\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#make\n......\n#make install\n.....\n<\/pre><\/div>\n\n\n<p>\u5efa\u7acb\u8f6f\u94fe\u63a5\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#ln -s \/usr\/local\/python3\/bin\/python3 \/usr\/bin\/python3\n......\n#ln -s \/usr\/local\/python3\/bin\/pip3 \/usr\/bin\/pip3\n<\/pre><\/div>\n\n\n<p>\u914d\u7f6e\u5b8c\u6210\u4e4b\u540e\uff0c\u6b64\u65f6\u7cfb\u7edf\u4e2d\u5b58\u5728\u4e24\u4e2apython\u7248\u672c\uff1a\u547d\u4ee4python\u5bf9\u5e94\u7684\u4ecd\u662f\u9ed8\u8ba42.x\u7248\u672c\uff1b\u547d\u4ee4python3\u5219\u5bf9\u5e94\u65b0\u5b89\u88c5\u76843.x\u7248\u672c\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# python\nPython 2.7.5 (default, Jun 28 2022, 15:30:04)\n&#x5B;GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2\nType &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.\n&gt;&gt;&gt; exit()\n# python3\nPython 3.11.1 (main, Feb  1 2023, 13:41:47) &#x5B;GCC 12.2.0] on linux\nType &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.\n&gt;&gt;&gt; exit()\n<\/pre><\/div>\n\n\n<p>\u68c0\u67e5\u8f6f\u94fe\u63a5\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# python3 -V\nPython 3.11.1\n# pip3 -V\npip 22.3.1 from \/usr\/local\/python3\/lib\/python3.11\/site-packages\/pip (python 3.11)\n<\/pre><\/div>\n\n\n<p>\u81f3\u6b64\uff0c\u7cfb\u7edf\u5347\u7ea7\u81f3Python-3.11.1\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u5b89\u88c5openssl\u6a21\u5757<\/h1>\n\n\n\n<p>\u5728Python3.10\u53ca\u66f4\u9ad8\u7248\u672c\u4e2d\uff0c\u7531\u4e8e\u4e0d\u518d\u652f\u6301libressl\uff0c\u9700\u8981\u4f7f\u7528openssl\u8fdb\u884c\u7f16\u8bd1\u5b89\u88c5\u4ee5\u89e3\u51b3SSL\u6a21\u5757\u5bfc\u5165\u5931\u8d25\u7684\u95ee\u9898\u3002\u5982\u679c\u9700\u8981\u5b89\u88c5openssl\u6a21\u5757\uff0c\u5219\u9700\u8981\u6309\u7167\u4ee5\u4e0b\u64cd\u4f5c\u6267\u884c\uff1a<\/p>\n\n\n\n<p>\u5728\u89e3\u538bPython\u6e90\u4ee3\u7801\u5305\u4e4b\u540e\uff0c\u9700\u8981\u4fee\u6539Modules\u76ee\u5f55\u4e0b\u7684Setup\u6587\u4ef6\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u2026\u2026 \n#To statically link OpenSSL: \n_ssl _ssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) \\ \n    -l:libssl.a -Wl,--exclude-libs,libssl.a \\ \n    -l:libcrypto.a -Wl,--exclude-libs,libcrypto.a \n_hashlib _hashopenssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) \\ \n    -l:libcrypto.a -Wl,--exclude-libs,libcrypto.a \n\u2026\u2026\n<\/pre><\/div>\n\n\n<p>\u5373\uff0c\u53bb\u6389\u524d\u9762\u7684\u201c#\u201d\uff0c\u5f00\u542f\u914d\u7f6e\u9879\u76ee\u3002<\/p>\n\n\n\n<p>\u53e6\u5916\uff0c\u518d\u4f7f\u7528configure\u8bbe\u7f6e\u7f16\u8bd1\u9009\u9879\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.\/configure --prefix=\/usr\/local\/python3 --with-zlib=\/usr\/include\/ --with-openssl-rpath=auto --with-openssl=\/usr\/include\/openssl OPENSSL_LDFLAGS=-L\/usr\/include\/openssl OPENSSL_LIBS=-l\/usr\/include\/openssl\/ssl OPENSSL_INCLUDES=-I\/usr\/include\/openssl\n<\/pre><\/div>\n\n\n<p>\u6700\u540e\u518d\u5f00\u59cb\u7f16\u8bd1\u548c\u5b89\u88c5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python\u811a\u672c\u4ece2.x\u7248\u672c\u52303.x\u7248\u672c\u6709\u6bd4\u8f83\u5927\u7684\u66f4\u6539\u3002\u4e3a\u4e86\u4fdd\u8bc1\u7cfb\u7edf\u7684\u517c\u5bb9\u6027\uff0c\u539f\u6709\u7684Python 2.x\u811a\u672c\u73af [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[11,10,15],"class_list":["post-103","post","type-post","status-publish","format-standard","hentry","category-technology","tag-centos","tag-linux","tag-python"],"_links":{"self":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/posts\/103"}],"collection":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/comments?post=103"}],"version-history":[{"count":5,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":1988,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/posts\/103\/revisions\/1988"}],"wp:attachment":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/media?parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/categories?post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/tags?post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}