{"id":45,"date":"2017-11-26T20:11:22","date_gmt":"2017-11-26T11:11:22","guid":{"rendered":"http:\/\/minatopj.php.xdomain.jp\/?p=45"},"modified":"2020-02-07T23:04:29","modified_gmt":"2020-02-07T14:04:29","slug":"ubuntu-17-10%e3%81%a7python%e9%96%8b%e7%99%ba%e7%92%b0%e5%a2%83","status":"publish","type":"post","link":"https:\/\/blog.minatoproject.com\/?p=45","title":{"rendered":"Ubuntu 17.10\u3067Python\u958b\u767a\u74b0\u5883"},"content":{"rendered":"<div class=\"veu_autoEyeCatchBox\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2017\/11\/20171126_eyecatch-1024x576.png\" class=\"attachment-large size-large wp-post-image\" alt=\"\" srcset=\"https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2017\/11\/20171126_eyecatch-1024x576.png 1024w, https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2017\/11\/20171126_eyecatch-300x169.png 300w, https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2017\/11\/20171126_eyecatch-768x432.png 768w, https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2017\/11\/20171126_eyecatch-320x180.png 320w, https:\/\/blog.minatoproject.com\/wp-content\/uploads\/2017\/11\/20171126_eyecatch.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/div>\n<p>\u4eca\u66f4\u30ed\u30fc\u30ab\u30eb\u3067\u2026\u2026\u3063\u3066\u611f\u3058\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u81ea\u5b85\u3067\u6a5f\u68b0\u5b66\u7fd2\u3084\u3089\u30af\u30ed\u30fc\u30ea\u30f3\u30b0\u3084\u3089\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3084\u3089\u3092\u3084\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3063\u3066VirtualBox\u3067\u6700\u65b0\u306eUbuntu\u3092\u30a4\u30f3\u30b9\u30b3\u3057\u3066\u307f\u305f\u306f\u3044\u3044\u3082\u306e\u306e\u3001\u306a\u304b\u306a\u304b\u3069\u3046\u3057\u3066\u3053\u308c\u304c\u624b\u9593\u53d6\u3063\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u5099\u5fd8\u9332\u304c\u3066\u3089\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ubuntu 17.10 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>\u7701\u7565\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3053\u308c\u3067\u65e5\u672c\u8a9e\u5165\u529b\u3060\u3063\u305f\u308avim\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3060\u3063\u305f\u308a\u8272\u3005\u30cf\u30de\u308a\u3069\u3053\u308d\u306f\u591a\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u3053\u307e\u3067\u7d39\u4ecb\u3057\u3066\u3044\u308b\u3068\u591c\u304c\u660e\u3051\u3066\u3057\u307e\u3046\u306e\u3067\uff08\u73fe\u5728\u5348\u524d1\u6642\uff09\u5404\u81ea\u30b0\u30b0\u3063\u3066\u89e3\u6c7a\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d1\u30c3\u30b1\u30fc\u30b8\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>\u3068\u308a\u3042\u3048\u305a\u3044\u3064\u3082\u306e\u3084\u3064\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\"><code>hogeuser:~$ sudo apt-get install git gcc make openssl libssl-dev libbz2-dev libreadline-dev libsqlite3-dev\n# \u63cf\u753b\u7cfb\u30e9\u30a4\u30d6\u30e9\u30ea\nhogeuser:~$ sudo apt-get install python3-tk tk-dev python-tk libfreetype6-dev\n# easy_install\u306e\u305f\u3081\u306b\nhogeuser:~$ sudo apt-get install python-setuptools<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">pyenv\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>pyenv\u3092git\u304b\u3089\u76f4\u63a5\u6301\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\"><code>hogeuser:~$ git clone https:\/\/github.com\/yyuu\/pyenv.git ~\/.pyenv<\/code><\/pre><\/div>\n\n\n\n<p>.bashrc\u306b\u74b0\u5883\u8a2d\u5b9a\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-bash\" data-file=\".bashrc\" data-lang=\"Bash\"><code># Python Settings\nexport PYENV_ROOT=$HOME\/.pyenv\nexport PATH=$PYENV_ROOT\/bin:$PATH\neval &quot;$(pyenv init -)&quot;<\/code><\/pre><\/div>\n\n\n\n<p>\u518d\u8aad\u8fbc\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\"><code>hogeuser:~$ source .bashrc<\/code><\/pre><\/div>\n\n\n\n<p>\u4e00\u5fdc\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d\u3057\u3068\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\"><code>hogeuser:~$ python -V\nPython 2.7.14\nhogeuser:~$ pyenv --version\npyenv 1.1.5-44-g85a66a9<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u4eee\u60f3\u74b0\u5883\u69cb\u7bc9<\/h2>\n\n\n\n<p>\u540c\u4e00\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u8907\u6570\u4f7f\u3044\u5206\u3051\u308b\u305f\u3081\u306bvirtualenv\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\"><code>hogeuser:~$ sudo easy_install virtualenv<\/code><\/pre><\/div>\n\n\n\n<p>\u304a\u597d\u304d\u306apyenv\u3092\u5165\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\"><code># \u9069\u5f53\u306a\u540d\u524d\u3067grep\u304b\u3051\u3066...\nhogeuser:~$ pyenv install --list | grep [\u30d0\u30fc\u30b8\u30e7\u30f3\u306a\u3069]\n# \u5165\u308c\u308b\nhogeuser:~$ pyenv install anaconda3-5.0.0<\/code><\/pre><\/div>\n\n\n\n<p>\u5165\u308c\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30b7\u30b9\u30c6\u30e0\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\"><code>hogeuser:~$ pyenv global anaconda3-5.0.0\n(anaconda3-5.0.0) hogeuser:~$ python -V\n# Python\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3082\u5909\u308f\u3063\u3066\u3044\u308b\nPython 3.6.2 :: Anaconda, Inc.<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u72b6\u614b\u3067\uff08exit\u3057\u3066\u3082\u5927\u4e08\u592b\u3067\u3059\u304c\uff09virtualenv\u3059\u308b\u3068\u3001\u3053\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u4eee\u60f3\u74b0\u5883\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\"><code># Python\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\/user\/bin\/\u306b\u3042\u308b\u3082\u306e\u304c\u4f7f\u3048\u308b\u3089\u3057\u3044\nhogeuser:~$ virtualenv --python=\/usr\/bin\/python3.6 testenv\nRunning virtualenv with interpreter \/usr\/bin\/python3.6\nUsing base prefix &#39;\/usr&#39;\nNew python executable in \/home\/hogeuser\/testenv\/bin\/python3.6\nAlso creating executable in \/home\/aosagitest\/testenv\/bin\/python\nInstalling setuptools, pip, wheel...done.<\/code><\/pre><\/div>\n\n\n\n<p>\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8\u3059\u308c\u3070\u7d42\u4e86\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plane\"><code>hogeuser:~$ . testenv\/bin\/activate\n(testenv) hogeuser:~$ python -V\n# conda\u306f\u7d99\u627f\u3055\u308c\u3066\u306a\u3044\u3051\u3069\u3068\u308a\u3048\u3042\u305a3.6\u7cfb\u304c\u5165\u3063\u305f\nPython 3.6.3<\/code><\/pre><\/div>\n\n\n\n<p>\u672c\u5f53\u306f\u3053\u306e\u4e0a\u3067VSCode\u52d5\u304b\u3059\u65b9\u6cd5\u3068\u304b\u307e\u3067\u7d39\u4ecb\u3057\u305f\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u6642\u9593\u304c\u306a\u3044\u306e\u3067\u3068\u308a\u3042\u3048\u305a\u4eca\u65e5\u306f\u3053\u3053\u307e\u3067\u3002<\/p>\n\n\n\n<p>pyenv-virtualenv\u306e\u65b9\u306f\u4f55\u3089\u304b\u306e\u64cd\u4f5c\u304c\u3046\u307e\u304f\u3044\u304b\u3093\u304f\u3066\u3084\u3081\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u6b63\u653b\u6cd5\u3058\u3083\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u6b63\u3057\u3044\u3084\u308a\u65b9\u77e5\u3063\u3066\u308b\u65b9\u3044\u305f\u3089\u6559\u3048\u3066\u4e0b\u3055\u3044\uff3c( \u2018\u03c9\u2019)\uff0f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u66f4\u30ed\u30fc\u30ab\u30eb\u3067\u2026\u2026\u3063\u3066\u611f\u3058\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u81ea\u5b85\u3067\u6a5f\u68b0\u5b66\u7fd2\u3084\u3089\u30af\u30ed\u30fc\u30ea\u30f3\u30b0\u3084\u3089\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3084\u3089\u3092\u3084\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3063\u3066VirtualBox\u3067\u6700\u65b0\u306eUbuntu\u3092\u30a4\u30f3\u30b9\u30b3\u3057\u3066\u307f\u305f\u306f\u3044\u3044\u3082\u306e\u306e\u3001\u306a\u304b\u306a\u304b\u3069\u3046\u3057\u3066\u3053\u308c\u304c\u624b\u9593\u53d6\u3063\u3066\u3057 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1628,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"vkexunit_cta_each_option":"","footnotes":""},"categories":[6,4],"tags":[],"class_list":["post-45","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-linux"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/posts\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=45"}],"version-history":[{"count":2,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":1797,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/posts\/45\/revisions\/1797"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=\/wp\/v2\/media\/1628"}],"wp:attachment":[{"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.minatoproject.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}