{"id":982,"date":"2024-02-13T02:33:24","date_gmt":"2024-02-12T17:33:24","guid":{"rendered":"https:\/\/www.aqua-informatics.jp\/?p=982"},"modified":"2024-05-28T11:20:22","modified_gmt":"2024-05-28T02:20:22","slug":"raspberry-pi-5%e3%81%aepython%e7%92%b0%e5%a2%83","status":"publish","type":"post","link":"https:\/\/www.aqua-informatics.jp\/?p=982","title":{"rendered":"Raspberry Pi 5\u306ePython\u74b0\u5883"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.aqua-informatics.jp\/?p=982\/#%E3%81%AF%E3%81%98%E3%82%81%E3%81%AB\" >\u306f\u3058\u3081\u306b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.aqua-informatics.jp\/?p=982\/#%E3%81%A8%E3%81%93%E3%82%8D%E3%81%A7%E3%80%81PEP668%E3%81%A8%E3%81%AF%E2%80%A6\" >\u3068\u3053\u308d\u3067\u3001PEP668\u3068\u306f\u2026<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.aqua-informatics.jp\/?p=982\/#Python%E3%81%AE%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%E7%AE%A1%E7%90%86%E3%81%A8%E4%BB%AE%E6%83%B3%E7%92%B0%E5%A2%83\" >Python\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3068\u4eee\u60f3\u74b0\u5883<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.aqua-informatics.jp\/?p=982\/#-system-site-packages_%E3%82%AA%E3%83%97%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E9%81%A9%E7%94%A8\" >--system-site-packages \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u9069\u7528<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.aqua-informatics.jp\/?p=982\/#%E3%81%BE%E3%81%A8%E3%82%81\" >\u307e\u3068\u3081<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E3%81%AF%E3%81%98%E3%82%81%E3%81%AB\"><\/span>\u306f\u3058\u3081\u306b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Raspberry Pi 5\u3067\u3001Python\u74b0\u5883\u306e\u69cb\u7bc9\u306b\u624b\u9593\u53d6\u3063\u305f\u3002<br>\u57fa\u672c\u5f93\u6765\u306eRaspberry Pi OS\u3067\u306f\u7279\u306b\u6c17\u306b\u3059\u308b\u3053\u3068\u306a\u304f\u30b7\u30b9\u30c6\u30e0\u306ePython\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u4f7f\u7528\u3057\u3066\u3044\u305f\u306e\u3067\u3001\u8868\u9762\u4e0a\u306f\u554f\u984c\u306b\u306a\u3063\u3066\u3044\u306a\u304b\u3063\u305f\u3002\u307e\u305f\u3001Ubuntu\u3067\u306f\u3059\u3067\u306b\u30d0\u30fc\u30b8\u30e7\u30f323\u4ee5\u4e0a\u306epip\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u304c\u3001pyenv\u3067\u30b7\u30b9\u30c6\u30e0\u306ePython\u3068\u5207\u308a\u96e2\u3057\u3066\u3044\u305f\u306e\u3067\u554f\u984c\u306b\u6c17\u304c\u3064\u304b\u306a\u304b\u3063\u305f\u3002\u3057\u304b\u3057\u3001Raspberry Pi OS\u304cBookworm\u306b\u79fb\u884c\u3057\u3001PEP668\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u6709\u52b9\u306b\u306a\u3063\u305f\u3053\u3068\u304b\u3089\u554f\u984c\u304c\u767a\u899a\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3055\u3089\u306b\u56f0\u3063\u305f\u3053\u3068\u306b\u3001Raspberry Pi OS\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308bPython\u30e9\u30a4\u30d6\u30e9\u30ea\u306fpip install\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u3082\u306e\u3068\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u7570\u306a\u308b\u3002\u30b7\u30b9\u30c6\u30e0\u3068\u5225\u306ePython\u74b0\u5883\u3092\u5358\u7d14\u306b\u4f5c\u308b\u3060\u3051\u3067\u306f\u3046\u307e\u304f\u52d5\u4f5c\u3057\u306a\u3044\u554f\u984c\u304c\u751f\u3058\u305f\u3002\u3057\u305f\u304c\u3063\u3066\u3001Raspberry Pi OS\u306ePython\u958b\u767a\u74b0\u5883\u306f\u30b7\u30b9\u30c6\u30e0\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5f15\u304d\u7d9a\u304d\u4f7f\u3048\u308b\u3088\u3046\u306a\u74b0\u5883\u3067\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3068\u3044\u3046\u4e8b\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E3%81%A8%E3%81%93%E3%82%8D%E3%81%A7%E3%80%81PEP668%E3%81%A8%E3%81%AF%E2%80%A6\"><\/span>\u3068\u3053\u308d\u3067\u3001PEP668\u3068\u306f\u2026<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Raspberry Pi OS Bookworm\u3067\u306f\u3001PEP668\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u306f\u524d\u8ff0\u3057\u305f\u3002<br>\u3053\u306ePEP668\u306e\u6982\u8981\u3092Bard\u306b\u307e\u3068\u3081\u3066\u3082\u3089\u3063\u305f\u3002<\/p>\n\n\n\n<p>PEP668\u306f\u3001Python\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u30a4\u30f3\u30dd\u30fc\u30c8\u3092\u9ad8\u901f\u5316\u3059\u308b\u305f\u3081\u306e\u63d0\u6848\u3067\u3059\u30022022\u5e747\u670820\u65e5\u306b\u6b63\u5f0f\u306b\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\u3002<br>PEP668\u3067\u306f\u3001Python\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u30a4\u30f3\u30dd\u30fc\u30c8\u6642\u306b\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u4e8b\u524d\u306b\u8aad\u307f\u8fbc\u3093\u3067\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u3053\u3068\u3067\u3001\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u6642\u9593\u3092\u77ed\u7e2e\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u306b\u304b\u304b\u308b\u6642\u9593\u3092\u5927\u5e45\u306b\u77ed\u7e2e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>PEP668\u306e\u5177\u4f53\u7684\u306a\u52b9\u679c\u306f\u3001\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u306b\u304b\u304b\u308b\u6642\u9593\u3092\u5e73\u5747\u3067\u7d0430%\u77ed\u7e2e\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u306b\u304b\u304b\u308b\u6642\u9593\u3092\u6700\u5927\u3067\u7d0490%\u77ed\u7e2e\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p>PEP668\u306f\u3001Python\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5927\u5e45\u306b\u5411\u4e0a\u3055\u305b\u308b\u305f\u3081\u3001Python\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u6709\u52b9\u306b\u3057\u3066\u304a\u304f\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002\u306a\u304a\u3001PEP668\u306f\u3001\u5f37\u5236\u529b\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u30e6\u30fc\u30b6\u30fc\u306e\u5224\u65ad\u3067\u3001PEP668\u306e\u63a8\u5968\u306b\u5f93\u3046\u304b\u5426\u304b\u3092\u6c7a\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>PEP668\u306e\u5177\u4f53\u7684\u306a\u5185\u5bb9\u306f\u3001\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30e2\u30b8\u30e5\u30fc\u30eb\u30a4\u30f3\u30dd\u30fc\u30c8\u6642\u306b\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u4e8b\u524d\u306b\u8aad\u307f\u8fbc\u3093\u3067\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u3002<\/li>\n\n\n\n<li>\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30d1\u30b9\u540d\u3068\u30d0\u30fc\u30b8\u30e7\u30f3\u756a\u53f7\u3092\u30ad\u30fc\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u3002<\/li>\n\n\n\n<li>\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u6700\u521d\u306b\u30a4\u30f3\u30dd\u30fc\u30c8\u3055\u308c\u305f\u3068\u304d\u306b\u4f5c\u6210\u3055\u308c\u308b\u3002<\/li>\n\n\n\n<li>\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u5bb9\u91cf\u304c\u4e0d\u8db3\u3057\u305f\u5834\u5408\u3084\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u5909\u66f4\u3055\u308c\u305f\u5834\u5408\u306b\u66f4\u65b0\u3055\u308c\u308b\u3002<\/li>\n<\/ul>\n\n\n\n<p>PEP668\u306e\u9069\u7528\u65b9\u6cd5\u306f\u3001\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python 3.11\u4ee5\u964d\u3067\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067PEP668\u304c\u9069\u7528\u3055\u308c\u307e\u3059\u3002<\/li>\n\n\n\n<li>Python 3.10\u4ee5\u524d\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u65b9\u6cd5\u3067PEP668\u3092\u9069\u7528\u3057\u307e\u3059\u3002\n<ul class=\"wp-block-list\">\n<li>importlib.util.cache_module()\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u3002<\/li>\n\n\n\n<li>importlib.util.find_spec()\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u3055\u308c\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u53d6\u5f97\u3059\u308b\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>PEP668\u306e\u6ce8\u610f\u70b9\u306f\u3001\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span data-color=\"#f78da7\" style=\"background: linear-gradient(transparent 60%,rgba(247, 141, 167, 0.7) 0);\" class=\"vk_highlighter\">\u30e6\u30fc\u30b6\u30fc\u304c\u81ea\u7531\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u3068\u3001\u4e0d\u8981\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u767b\u9332\u3055\u308c\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u4f4e\u4e0b\u3084\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u8106\u5f31\u6027\u306e\u539f\u56e0\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u3002<\/span><\/li>\n\n\n\n<li><span data-color=\"#f78da7\" style=\"background: linear-gradient(transparent 60%,rgba(247, 141, 167, 0.7) 0);\" class=\"vk_highlighter\">\u30b7\u30b9\u30c6\u30e0\u306ePython\u306b\u30e6\u30fc\u30b6\u30fc\u304c\u30e9\u30a4\u30d6\u30e9\u30ea\u3092pip\u3067install\u3059\u308b\u3053\u3068\u306f\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u3002<\/span><\/li>\n<\/ul>\n\n\n\n<p>PEP668\u306f\u3001Python\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5411\u4e0a\u3055\u305b\u308b\u305f\u3081\u306e\u91cd\u8981\u306a\u63d0\u6848\u3067\u3059\u3002Python\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001PEP668\u306e\u6982\u8981\u3092\u7406\u89e3\u3057\u3001\u9069\u5207\u306b\u9069\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u5411\u4e0a\u3092\u56f3\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><br>\u4ee5\u4e0a\u306e\u3088\u3046\u306b\u3001\u6069\u6075\u3082\u591a\u3044\u304c\u3001pip install\u304c\u3067\u304d\u306a\u304f\u306a\u308b\u70b9\u306f\u4e0d\u4fbf\u306a\u306e\u3067\u3001\u958b\u767a\u7528\u3068\u30b7\u30b9\u30c6\u30e0\u7528\u306b\u5206\u3051\u308c\u3070\u3088\u3044\u3002\u305d\u3053\u3067\u3001\u30b7\u30b9\u30c6\u30e0\u306ePython \u3068\u30e6\u30fc\u30b6\u30fc\u304c\u958b\u767a\u306b\u4f7f\u7528\u3059\u308bPython \u3092\u5206\u96e2\u3059\u308b\u4eee\u60f3\u74b0\u5883\u306b\u3064\u3044\u3066\u8abf\u3079\u305f\u3002Ubuntu\u3067\u306f\u65e2\u306b\u4f7f\u3063\u3066\u3044\u308bpyenv\u3067\u3042\u308b\u304c\u3001virtualenv\u3082\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u305d\u3046\u3060\u3002\u3055\u3089\u306b\u3001venv\u3082\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u3068\u3053\u308d\u3067\u3001\u5177\u4f53\u7684\u306bsystem\u306ePython\u306b\u4f55\u304b\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u6b21\u306e\u3088\u3046\u306a\u8b66\u544a\u304c\u51fa\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>01:52 rpi@raspberrypi400-alpha:~\/Documents\n$python -m pip install virtualenv\nerror: externally-managed-environment\n\n\u00d7 This environment is externally managed\n\u2570\u2500&gt; To install Python packages system-wide, try apt install\n    python3-xyz, where xyz is the package you are trying to\n    install.\n    \n    If you wish to install a non-Debian-packaged Python package,\n    create a virtual environment using python3 -m venv path\/to\/venv.\n    Then use path\/to\/venv\/bin\/python and path\/to\/venv\/bin\/pip. Make\n    sure you have python3-full installed.\n    \n    For more information visit http:\/\/rptl.io\/venv\n\nnote: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.\nhint: See PEP 668 for the detailed specification.\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Python%E3%81%AE%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%E7%AE%A1%E7%90%86%E3%81%A8%E4%BB%AE%E6%83%B3%E7%92%B0%E5%A2%83\"><\/span>Python\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3068\u4eee\u60f3\u74b0\u5883<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5177\u4f53\u7684\u306bpyenv\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u4ee5\u4e0b\u3067\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/pyenv\/pyenv.git ~\/.pyenv<\/code><\/pre>\n\n\n\n<p>\u30a8\u30e9\u30fc\u51fa\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>02:54 rpi@raspberrypi400-alpha:~\/Documents\n$pyenv install 3.12.2\nDownloading Python-3.12.2.tar.xz...\n-&gt; https:\/\/www.python.org\/ftp\/python\/3.12.2\/Python-3.12.2.tar.xz\nInstalling Python-3.12.2...\nTraceback (most recent call last):\n  File \"&lt;string&gt;\", line 1, in &lt;module&gt;\n  File \"\/home\/rpi\/.pyenv\/versions\/3.12.2\/lib\/python3.12\/bz2.py\", line 17, in &lt;module&gt;\n    from _bz2 import BZ2Compressor, BZ2Decompressor\nModuleNotFoundError: No module named '_bz2'\nWARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?\nTraceback (most recent call last):\n  File \"&lt;string&gt;\", line 1, in &lt;module&gt;\n  File \"\/home\/rpi\/.pyenv\/versions\/3.12.2\/lib\/python3.12\/curses\/__init__.py\", line 13, in &lt;module&gt;\n    from _curses import *\nModuleNotFoundError: No module named '_curses'\nWARNING: The Python curses extension was not compiled. Missing the ncurses lib?\nTraceback (most recent call last):\n  File \"&lt;string&gt;\", line 1, in &lt;module&gt;\n  File \"\/home\/rpi\/.pyenv\/versions\/3.12.2\/lib\/python3.12\/ctypes\/__init__.py\", line 8, in &lt;module&gt;\n    from _ctypes import Union, Structure, Array\nModuleNotFoundError: No module named '_ctypes'\nWARNING: The Python ctypes extension was not compiled. Missing the libffi lib?\nTraceback (most recent call last):\n  File \"&lt;string&gt;\", line 1, in &lt;module&gt;\nModuleNotFoundError: No module named 'readline'\nWARNING: The Python readline extension was not compiled. Missing the GNU readline lib?\nTraceback (most recent call last):\n  File \"&lt;string&gt;\", line 1, in &lt;module&gt;\n  File \"\/home\/rpi\/.pyenv\/versions\/3.12.2\/lib\/python3.12\/ssl.py\", line 100, in &lt;module&gt;\n    import _ssl             # if we can't import it, let the error propagate\n    ^^^^^^^^^^^\nModuleNotFoundError: No module named '_ssl'\nERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?\n\nPlease consult to the Wiki page to fix the problem.\nhttps:&#47;&#47;github.com\/pyenv\/pyenv\/wiki\/Common-build-problems\n\n\nBUILD FAILED (Debian 12 using python-build 2.3.36-21-g7e550e31)\n\nInspect or clean up the working tree at \/tmp\/python-build.20240330025454.23787\nResults logged to \/tmp\/python-build.20240330025454.23787.log\n\nLast 10 log lines:\n\tesac; \\\n\tLD_LIBRARY_PATH=\/tmp\/python-build.20240330025454.23787\/Python-3.12.2 .\/python -E -m ensurepip \\\n\t\t$ensurepip --root=\/ ; \\\nfi\nLooking in links: \/tmp\/tmpd1exz6qv\nProcessing \/tmp\/tmpd1exz6qv\/pip-24.0-py3-none-any.whl\nInstalling collected packages: pip\n  WARNING: The scripts pip3 and pip3.12 are installed in '\/home\/rpi\/.pyenv\/versions\/3.12.2\/bin' which is not on PATH.\n  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\nSuccessfully installed pip-24.0<\/code><\/pre>\n\n\n\n<p>\u3044\u308d\u3044\u308d\u8db3\u308a\u3066\u3044\u306a\u304b\u3063\u305f\u6a21\u69d8\u3002\u4ee5\u524d\u306f\u6b21\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>03:45 rpi@raspberrypi400-alpha:~\n$sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm xz-utils tk-dev libffi-dev liblzma-dev\n<\/code><\/pre>\n\n\n\n<p>virtualenv\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>03:56 rpi@raspberrypi400-alpha:~\/Documents\n$git clone https:\/\/github.com\/pyenv\/pyenv-virtualenv.git $(pyenv root)\/plugins\/pyenv-virtualenv\nCloning into '\/home\/rpi\/.pyenv\/plugins\/pyenv-virtualenv'...\nremote: Enumerating objects: 2266, done.\nremote: Counting objects: 100% (195\/195), done.\nremote: Compressing objects: 100% (114\/114), done.\nremote: Total 2266 (delta 107), reused 142 (delta 74), pack-reused 2071\nReceiving objects: 100% (2266\/2266), 653.14 KiB | 1.57 MiB\/s, done.\nResolving deltas: 100% (1527\/1527), done.<\/code><\/pre>\n\n\n\n<p>\u4efb\u610f\u306ePython\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>03:47 rpi@raspberrypi400-alpha:~\n$pyenv install 3.12.1\nDownloading Python-3.12.1.tar.xz\u2026\n-&gt; https:\/\/www.python.org\/ftp\/python\/3.12.1\/Python-3.12.1.tar.xz\nInstalling Python-3.12.1\u2026\nInstalled Python-3.12.1 to \/home\/rpi\/.pyenv\/versions\/3.12.1<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"-system-site-packages_%E3%82%AA%E3%83%97%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E9%81%A9%E7%94%A8\"><\/span>--system-site-packages \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u9069\u7528<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u30b7\u30b9\u30c6\u30e0\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5f15\u304d\u7d9a\u304d\u5229\u7528\u3057\u3064\u3064\u3001\u4eee\u60f3\u74b0\u5883\u3092\u4f5c\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u898b\u51fa\u3057\u306b\u8a18\u8f09\u3057\u3066\u3044\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u76ee\u7684\u3092\u9054\u6210\u3067\u304d\u308b\u3002<br>\u5177\u4f53\u7684\u306b\u306f\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>04:00 rpi@raspberrypi400-alpha:~\n$pyenv virtualenv system virtualenv3.11.2-system-packages --system-site-packages\n        \nLooking in links: \/tmp\/tmpma2k66rc\nRequirement already satisfied: setuptools in \/home\/rpi\/.pyenv\/versions\/virtualenv3.11.2-system-packages\/lib\/python3.11\/site-packages (66.1.1)\nRequirement already satisfied: pip in \/home\/rpi\/.pyenv\/versions\/virtualenv3.11.2-system-packages\/lib\/python3.11\/site-packages (23.0.1)<\/code><\/pre>\n\n\n\n<p>\u3067\u3001Documents\u4ee5\u4e0b\u3092\u4eee\u60f3\u74b0\u5883\u3078<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>04:02 rpi@raspberrypi400-alpha:~\/Documents\n$pyenv versions\n  system\n* 3.12.1 (set by \/home\/rpi\/Documents\/.python-version)\n  virtualenv3.11.2-system-packages\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>04:02 rpi@raspberrypi400-alpha:~\/Documents\n$pyenv local virtualenv3.11.2-system-packages\n04:03 rpi@raspberrypi400-alpha:~\/Documents\n$pyenv versions\n  system\n  3.12.1\n* virtualenv3.11.2-system-packages (set by \/home\/rpi\/Documents\/.python-version)\n<\/code><\/pre>\n\n\n\n<p>.bashrc\u306e\u95a2\u9023\u8a18\u8ff0\u3002\u3053\u308c\u3067activate\u3001deactivate\u305b\u305a\u306b\u5229\u7528\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export PYENV_ROOT=\"$HOME\/.pyenv\"\ncommand -v pyenv &gt;\/dev\/null || export PATH=\"$PYENV_ROOT\/bin:$PATH\"\neval \"$(pyenv init --path)\"\n\neval \"$(pyenv virtualenv-init -)\"\nexport VIRTUAL_ENV_DISABLE_PROMPT=1 <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E3%81%BE%E3%81%A8%E3%82%81\"><\/span>\u307e\u3068\u3081<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u3053\u308c\u3067\u3001Raspberry Pi\u306b\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5229\u7528\u3067\u304d\u308b\u4eee\u60f3\u74b0\u5883\u3092\u69cb\u7bc9\u3067\u304d\u305f\u3002\u306a\u304a\u3001Raspberry Pi 5\u4ee5\u524d\u3001\u3053\u306e\u5834\u5408\u3001Raspberry Pi 400\u306e\u5834\u5408\u3001\u666e\u901a\u306bgpio\u95a2\u9023\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092pip\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3082\u554f\u984c\u306a\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u3002Raspberry Pi 5B\u306fI\/O\u5468\u308a\u304c\u5927\u304d\u304f\u5909\u66f4\u3055\u308c\u3066\u3044\u308b\u304b\u3089\u3060\u3002\u3042\u308b\u3044\u306f\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3092\u66f8\u3044\u305f\u6642\u70b9\u30675B\u304c\u3067\u304d\u306a\u3044\u3060\u3051\u3067\u3001\u305d\u306e\u3046\u3061\u5bfe\u5fdc\u3055\u308c\u308b\u53ef\u80fd\u6027\u3082\u9ad8\u3044\u3002<\/p>\n\n\n\n<p>\u3064\u307e\u308a\u3001\u672c\u5185\u5bb9\u306f\u5f53\u9762\u306e\u9593\u306e\u66ab\u5b9a\u7684\u306a\u5bfe\u5fdc\u304b\u3082\u3057\u308c\u306a\u3044\u3002\u4eee\u60f3\u74b0\u5883\u3082\u30c7\u30a3\u30b9\u30b3\u30f3\u4e88\u5b9a\u306e\u5185\u5bb9\u3067\u3001\u3044\u305a\u308cvenv\u306b\u79fb\u884c\u3059\u308b\u5fc5\u8981\u3082\u3042\u308b\u3057\u306d\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b Raspberry Pi 5\u3067\u3001Python\u74b0\u5883\u306e\u69cb\u7bc9\u306b\u624b\u9593\u53d6\u3063\u305f\u3002\u57fa\u672c\u5f93\u6765\u306eRaspberry Pi OS\u3067\u306f\u7279\u306b\u6c17\u306b\u3059\u308b\u3053\u3068\u306a\u304f\u30b7\u30b9\u30c6\u30e0\u306ePython\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u4f7f\u7528\u3057\u3066\u3044\u305f\u306e\u3067\u3001\u8868\u9762\u4e0a\u306f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":87,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"common","vkexunit_cta_each_option":"","_lightning_design_setting":{"layout":"default"},"footnotes":""},"categories":[7,8],"tags":[],"class_list":["post-982","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-python"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=\/wp\/v2\/posts\/982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=982"}],"version-history":[{"count":29,"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=\/wp\/v2\/posts\/982\/revisions"}],"predecessor-version":[{"id":1149,"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=\/wp\/v2\/posts\/982\/revisions\/1149"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=\/wp\/v2\/media\/87"}],"wp:attachment":[{"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}