{"id":940,"date":"2024-01-10T09:11:10","date_gmt":"2024-01-10T00:11:10","guid":{"rendered":"https:\/\/www.aqua-informatics.jp\/?p=940"},"modified":"2024-01-10T11:36:04","modified_gmt":"2024-01-10T02:36:04","slug":"raspberry-pi-5b%e5%a7%8b%e5%8b%95","status":"publish","type":"post","link":"https:\/\/www.aqua-informatics.jp\/?p=940","title":{"rendered":"Raspberry pi 5b\u59cb\u52d5"},"content":{"rendered":"\n<p>Raspberry Pi 5\u3092\u59cb\u52d5\u3055\u305b\u305f\u3002\u7a3c\u50cd\u4e2d\u306eRaspberry Pi\u306f\u3059\u3079\u306610\u5206\u3054\u3068\u306bCPU\u6e29\u5ea6\u3092\u8a18\u9332\u3057\u3066\u3044\u308b\u2026\u3068\u601d\u3046\u3002\u4eca\u56de\u3001Raspberry Pi \u03b7\u304c\u8a18\u9332\u304b\u3089\u6f0f\u308c\u3066\u3044\u305f\u306e\u3067\u3001\u4eca\u56de5B\u3068\u540c\u6642\u306b\u8a18\u9332\u3092\u958b\u59cb\u3057\u3066\u3044\u308b\u3002(\u8ffd\u8a18: \u4f55\u3068\u3044\u3046\u3053\u3068\u3067\u3057\u3087\u3046\u3001\u03b6\u3082\u6f0f\u308c\u3066\u3044\u305f)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"452\" src=\"https:\/\/www.aqua-informatics.jp\/wp-content\/uploads\/2024\/01\/image-1.png\" alt=\"\" class=\"wp-image-943\" srcset=\"https:\/\/www.aqua-informatics.jp\/wp-content\/uploads\/2024\/01\/image-1.png 712w, https:\/\/www.aqua-informatics.jp\/wp-content\/uploads\/2024\/01\/image-1-300x190.png 300w\" sizes=\"auto, (max-width: 712px) 100vw, 712px\" \/><\/figure>\n\n\n\n<p>cron\u3067\u5b9a\u671f\u7684\u306bPython\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066MySQL\u30b5\u30fc\u30d0\u30fc\u306b\u6e29\u5ea6\u306e\u8a18\u9332\u3092\u884c\u3063\u3066\u3044\u308b\u3002\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u306b\u4f34\u3044\u4e0d\u8db3\u3057\u3066\u3044\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3060\u304c\u3001\u6b21\u306e\u3088\u3046\u306a\u8b66\u544a\u304c\u3067\u305f\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>04:16 rpi@raspberrypi5b-alpha:~\/Documents\/CPU_temp\n$python3 -m pip install pymysql\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.<\/code><\/pre><\/div>\n\n\n\n<p>\u4eca\u56de\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b7\u30b9\u30c6\u30e0\u306ePython3\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3057\u307e\u3063\u305f\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>04:19 rpi@raspberrypi5b-alpha:~\/Documents\/CPU_temp\n$sudo apt install python3-pymysql\nReading package lists... Done\nBuilding dependency tree... Done\nReading state information... Done\nSuggested packages:\n  python-pymysql-doc\nThe following NEW packages will be installed:\n  python3-pymysql\n0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.\nNeed to get 42.2 kB of archives.\nAfter this operation, 177 kB of additional disk space will be used.\nGet:1 http:\/\/deb.debian.org\/debian bookworm\/main arm64 python3-pymysql all 1.0.2-2 [42.2 kB]\nFetched 42.2 kB in 0s (178 kB\/s)     \nSelecting previously unselected package python3-pymysql.\n(Reading database ... 127342 files and directories currently installed.)\nPreparing to unpack ...\/python3-pymysql_1.0.2-2_all.deb ...\nUnpacking python3-pymysql (1.0.2-2) ...\nSetting up python3-pymysql (1.0.2-2) ...<\/code><\/pre><\/div>\n\n\n\n<p>\u30a8\u30e9\u30fc\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u5185\u306b\u4ee5\u4e0b\u306e\u69d8\u306a\u8a18\u8ff0\u304c\u3042\u308b\u306e\u3067\u3001Python\u306e\u4eee\u60f3\u74b0\u5883\u3067\u5229\u7528\u3059\u308b\u306e\u304c\u597d\u307e\u3057\u3044\u3088\u3046\u3060\u3002\u3055\u3066\u3001\u3053\u308c\u307e\u3067\u3053\u306e\u69d8\u306a\u30a8\u30e9\u30fc\u306f\u51fa\u3066\u3044\u306a\u304b\u3063\u305f\u3002Raspberry Pi OS\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u65b0\u65e7\u306e\u9055\u3044\u306a\u306e\u304b\u3001\u3042\u308b\u3044\u306f\u3001\u4eca\u56de64bit\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u306e\u3067\u300132bit\u306864bit\u306e\u9055\u3044\u306a\u306e\u304b\u5b9a\u304b\u3067\u306f\u306a\u3044\u304c\u3001\u3044\u305a\u308c\u306b\u3057\u3066\u3082Ubuntu\u3068\u540c\u69d8\u306bPython\u306e\u4eee\u60f3\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u305d\u3046\u3060\u3002<\/p>\n\n\n\n<p><span data-color=\"#f78da7\" style=\"background: linear-gradient(transparent 60%,rgba(247, 141, 167, 0.7) 0);\" class=\"vk_highlighter\">If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path\/to\/venv. Then use path\/to\/venv\/bin\/python and path\/to\/venv\/bin\/pip. Make sure you have python3-full installed.<\/span><\/p>\n\n\n\n<p>\u8ffd\u8a18: \u6c17\u306b\u306a\u3063\u305f\u306e\u3067\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3002<br>bookworm\u306b\u306a\u3063\u3066\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>09:13 rpi@raspberrypi4b-gamma:~\n$uname -a\nLinux raspberrypi4b-gamma 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU\/Linux\n\n09:13 rpi@raspberrypi4b-gamma:~\n$lsb_release -a\nNo LSB modules are available.\nDistributor ID: Raspbian\nDescription:    Raspbian GNU\/Linux 11 (bullseye)\nRelease:        11\nCodename:       bullseye\n\n\n09:14 rpi@raspberrypi5b-alpha:~\n$uname -a\nLinux raspberrypi5b-alpha 6.1.0-rpi7-rpi-2712 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU\/Linux\n\n09:15 rpi@raspberrypi5b-alpha:~\n$lsb_release -a\nNo LSB modules are available.\nDistributor ID:\tDebian\nDescription:\tDebian GNU\/Linux 12 (bookworm)\nRelease:\t12\nCodename:\tbookworm\n<\/code><\/pre>\n\n\n\n<p>\u3042\u3068\u3001\u521d\u56de\u8d77\u52d5\u6642\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30c7\u30fc\u30d6\u30eb\u304c\u306a\u3044\u3063\u3066\u30a8\u30e9\u30fc\u304c\u5f97\u308b\u306e\u3067\u5bfe\u51e6\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>04:19 rpi@raspberrypi5b-alpha:~\/Documents\/CPU_temp\n$python3 CPU_Temp_sql.py \nTraceback (most recent call last):\n  File &quot;\/home\/rpi\/Documents\/CPU_temp\/CPU_Temp_sql.py&quot;, line 64, in &lt;module&gt;\n    row_num = cur2.execute(&quot;SELECT COUNT(*) FROM environment;&quot;).fetchone()[0]\n              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nsqlite3.OperationalError: no such table: environment\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File &quot;\/home\/rpi\/Documents\/CPU_temp\/CPU_Temp_sql.py&quot;, line 99, in &lt;module&gt;\n    sql = &#39;INSERT INTO environment VALUES (\\&#39;%s\\&#39;, %s, %s, %s)&#39; % (db_data)\n          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~\nTypeError: not enough arguments for format string\n<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Raspberry Pi 5\u3092\u59cb\u52d5\u3055\u305b\u305f\u3002\u7a3c\u50cd\u4e2d\u306eRaspberry Pi\u306f\u3059\u3079\u306610\u5206\u3054\u3068\u306bCPU\u6e29\u5ea6\u3092\u8a18\u9332\u3057\u3066\u3044\u308b\u2026\u3068\u601d\u3046\u3002\u4eca\u56de\u3001Raspberry Pi \u03b7\u304c\u8a18\u9332\u304b\u3089\u6f0f\u308c\u3066\u3044\u305f\u306e\u3067\u3001\u4eca\u56de5B\u3068\u540c\u6642\u306b\u8a18\u9332\u3092\u958b\u59cb\u3057\u3066\u3044 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":91,"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-940","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\/940","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=940"}],"version-history":[{"count":10,"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=\/wp\/v2\/posts\/940\/revisions"}],"predecessor-version":[{"id":951,"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=\/wp\/v2\/posts\/940\/revisions\/951"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=\/wp\/v2\/media\/91"}],"wp:attachment":[{"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aqua-informatics.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}