{"id":448,"date":"2020-02-21T17:42:25","date_gmt":"2020-02-21T09:42:25","guid":{"rendered":"http:\/\/www.inhhh.com\/blog\/?p=448"},"modified":"2023-02-09T12:31:51","modified_gmt":"2023-02-09T04:31:51","slug":"centos-7%e5%ae%89%e8%a3%85python3-7-2%e5%a4%9a%e7%89%88%e6%9c%ac%e5%85%b1%e5%ad%98","status":"publish","type":"post","link":"http:\/\/www.inhhh.com\/blog\/?p=448","title":{"rendered":"Centos 7\u5b89\u88c5python3.7.2\u591a\u7248\u672c\u5171\u5b58"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\"><a href=\"https:\/\/www.cnblogs.com\/ElegantSmile\/p\/10839865.html\">CentOS 7.6 \u5b89\u88c5Python3.7.2 \u591a\u7248\u672c\u5171\u5b58<\/a><\/h1>\n\n\n\n<p>CentOS 7.6 \u9ed8\u8ba4\u5b89\u88c5\u4e86 Python 2.7.5<\/p>\n\n\n\n<p>\u51c6\u5907\u73af\u5883<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">yum install libXcomposite libXcursor libXi libXtst libXrandr alsa-lib mesa-libEGL libXdamage mesa-libGL libXScrnSaver -y<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">yum install libffi-devel -y \n# Python3.7\u53ca\u4ee5\u4e0a\u7248\u672c\u9700\u8981\u5b89\u88c5libffi-devel\uff0c\u5426\u5219\u5b89\u88c5\u65f6\u4f1a\u62a5\u9519 ModuleNotFoundError: No module named \u2018_ctypes\u2019 \u9519\u8bef<\/pre>\n\n\n\n<p>\u4e0b\u8f7d<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget https:\/\/www.python.org\/ftp\/python\/3.7.2\/Python-3.7.2.tar.xz<\/pre>\n\n\n\n<p>\u89e3\u538b<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tar -xvJf Python-3.7.2.tar.xz<\/pre>\n\n\n\n<p>\u7f16\u8bd1\u3001\u5b89\u88c5<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd Python-3.7.2\/\n.\/configure --enable-shared --prefix=\/usr\/local CFLAGS=-fPIC LDFLAGS=\"-Wl,-rpath \/usr\/local\/lib\"\nmake -j24\nmake install<\/pre>\n\n\n\n<p>\u505a\u8f6f\u94fe\u63a5<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ln -sf \/usr\/local\/bin\/python3.7 \/usr\/bin\/python3\nln -sf \/usr\/local\/bin\/python3.7 \/usr\/bin\/python3.7\nln -sf \/usr\/local\/bin\/pip3.7 \/usr\/bin\/pip3\nln -sf \/usr\/local\/bin\/pip3.7 \/usr\/bin\/pip3.7<\/pre>\n\n\n\n<p>\u6d4b\u8bd5\u5b89\u88c5\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python3 --version<\/pre>\n\n\n\n<p>\u5207\u6362python\u4e3apython3<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rm -f \/usr\/bin\/python\r\nrm -f \/usr\/bin\/pip\r\nln -sf \/usr\/local\/python3\/bin\/python3 \/usr\/bin\/python\r\nln -sf \/usr\/local\/python3\/bin\/pip3 \/usr\/bin\/pip<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>CentOS 7.6 \u5b89\u88c5Python3.7.2 \u591a\u7248\u672c\u5171\u5b58 CentOS 7.6 \u9ed8\u8ba4\u5b89\u88c5\u4e86 Python <\/p>\n<div class=\"more-link\">\n\t\t\t\t <a href=\"http:\/\/www.inhhh.com\/blog\/?p=448\" class=\"link-btn theme-btn\"><span>Read More <\/span> <i class=\"fa fa-caret-right\"><\/i><\/a>\n\t\t\t<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-448","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=448"}],"version-history":[{"count":2,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/448\/revisions"}],"predecessor-version":[{"id":649,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/448\/revisions\/649"}],"wp:attachment":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=448"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}