{"id":6596,"date":"2019-03-10T13:45:22","date_gmt":"2019-03-10T04:45:22","guid":{"rendered":"http:\/\/stuffy.dip.jp\/wordpress\/?p=6596"},"modified":"2019-03-10T21:06:36","modified_gmt":"2019-03-10T12:06:36","slug":"build-python3-from-source","status":"publish","type":"post","link":"https:\/\/www.stuffy.site\/wordpress\/?p=6596","title":{"rendered":"Python3 \u3092\u30bd\u30fc\u30b9\u304b\u3089\u30d3\u30eb\u30c9"},"content":{"rendered":"<p><a href=\"https:\/\/shimi-dai.com\/install-python3-on-linux\/\">Linux\u306bPython3\u7cfb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u624b\u9806<\/a>\u00a0\u3092\u53c2\u8003\u306bPython3 \u3092\u30bd\u30fc\u30b9\u304b\u3089\u30d3\u30eb\u30c9\u3002<\/p>\n<p>\u307e\u305a\u3001yum \u304b\u3089\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre># yum install make gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel<\/pre>\n<p>Python3.7.2 \u3092wget \u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3001\u4fdd\u5b58\u3002<\/p>\n<pre># cd \/usr\/local\/src\r\n# wget https:\/\/www.python.org\/ftp\/python\/3.7.2\/Python-3.7.2.tgz<\/pre>\n<p>\u5727\u7e2e\u30d5\u30a1\u30a4\u30eb\u3092\u89e3\u51cd\u3001make &amp;&amp; make install<\/p>\n<pre># tar xvzf Python-3.7.2.tgz\r\n# cd Python-3.7.2\r\n# .\/configure --prefix=\/usr\/local\/python\r\n# make &amp;&amp; make install<\/pre>\n<p>\u3053\u3053\u3067libffi \u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u306e\u30a8\u30e9\u30fc\u3002<\/p>\n<pre>ModuleNotFoundError: No module named '_ctypes'\r\nmake: *** [install] Error 1<\/pre>\n<p>yum \u3067libffi-devel \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3001\u518d\u30c1\u30e3\u30ec\u30f3\u30b8\u3002\u6210\u529f\u3002<\/p>\n<pre># yum install libffi-devel<\/pre>\n<p>.\/bash_profile \u306b\u30d1\u30b9\u3092\u8ffd\u8a18\u3002<\/p>\n<pre># vi ~\/.bash_profile\r\n \r\n\u2193\u3092\u8ffd\u8a18\r\nexport PATH=$PATH:\/usr\/local\/python\/bin\r\n<\/pre>\n<p>\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3092\u8cbc\u3063\u3066<\/p>\n<pre># ln -s \/usr\/local\/python\/bin\/python3 \/usr\/local\/bin\/python\r\n# ln -s \/usr\/local\/python\/bin\/pip3.7 \/usr\/local\/bin\/pip<\/pre>\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u518d\u8d77\u52d5\u3002\u30d1\u30b9\u3092\u53cd\u6620\u3055\u305b\u3066 python &#8211;version \u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d\u3002<\/p>\n<p><a href=\"https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2019\/03\/2019-03-10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6597\" src=\"https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2019\/03\/2019-03-10.png\" alt=\"\" width=\"659\" height=\"486\" srcset=\"https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2019\/03\/2019-03-10.png 659w, https:\/\/www.stuffy.site\/wordpress\/wp-content\/uploads\/2019\/03\/2019-03-10-300x221.png 300w\" sizes=\"auto, (max-width: 659px) 100vw, 659px\" \/><\/a><\/p>\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u306bPython3\u7cfb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u624b\u9806\u00a0\u3092\u53c2\u8003\u306bPython3 \u3092\u30bd\u30fc\u30b9\u304b\u3089\u30d3\u30eb\u30c9\u3002 \u307e\u305a\u3001yum \u304b\u3089\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002 # yum install make gcc zlib-devel b &hellip; <a href=\"https:\/\/www.stuffy.site\/wordpress\/?p=6596\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">Python3 \u3092\u30bd\u30fc\u30b9\u304b\u3089\u30d3\u30eb\u30c9<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[98],"tags":[],"class_list":["post-6596","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6596"}],"version-history":[{"count":5,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6596\/revisions"}],"predecessor-version":[{"id":6602,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/6596\/revisions\/6602"}],"wp:attachment":[{"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stuffy.site\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}