ラベル ChromeBook の投稿を表示しています。 すべての投稿を表示
ラベル ChromeBook の投稿を表示しています。 すべての投稿を表示

2022年8月9日火曜日

ChromebookのDebian 10(buster)をDebian 11(bullseye)にアップグレードメモ

 ChromebookのDebian10をDebian11へのアップグレードはPythonの開発環境が動作しなくなるのが困るのでそのままにしていたけれどさすがにアップグレードしてみました。

アップグレードするにあたり念の為バックアップは実施しておきます、バックアップがあればDebian10に簡単に復元可能でした(実際復元することになりました・・・)

いざアップグレードを始めると空き容量が少なくなってきたとのメッセージが画面左下で表示してからしばらくするとアップグレード失敗のメッセージが表示されました。

ログが保存されるので確認してみると

E: You don't have enough free space in /var/cache/apt/archives/.

282 upgraded, 171 newly installed, 15 to remove and 0 not upgraded.
Need to get 418 MB of archives. 

After this operation, 26.5 MB of additional disk space will be used.

不安が的中し空き容量不足が発生、それでもターミナルで接続しバージョンを確認してみると

~$cat /etc/debian_version
11.4

とりあえずバージョンアップをしている模様

念の為aptコマンドでアップデートコマンドを実行してみると

sudo apt update
sudo apt upgrade
E: dpkg は中断されました。問題を修正するには 'sudo dpkg --configure -a' を手動

やはり不完全な状態であることが判明、このまま原因と対応を考えのは時間を無駄にしそうだったのでLinux(Debian)への割当容量を増やしてアップグレード作業直前のバックアップからDebian10に復元しあらためてアップグレードをしてみたところ問題なく完了しました。

あらためてaptコマンドでアップデートコマンドを実行してみるとパッケージは全て最新とのメッセージ。

とりあえずアップグレードは完了したもののPython開発環境が問題なく使用できるかはあらためて。

2021年11月7日日曜日

Chromebookを外に持ち出す(楽天モバイルRakuten WiFi Pocket 2を使用)

 最近、Chromebookを外に持ち出すことが多く、無料のWi-Fiを使用していましたが、利用場所が制限されるのでなんとかしたいと思っていました。

ちょうど楽天モバイルRakuten WiFi Pocket 2 本体価格1円キャンペーンが行われていることを知りました。ただこの手のキャンペーンいや回線に関わるサービス全般は本当に分かりにくく不利なことや制約は小さくあまり信用していません。が、結果的には今回契約しました。

【良かったこと】

・契約自体は1時間程度で完了し、その場で機械も受け取れすぐに使用できました。

・Wi-Fiルーターは思いのほか小さく軽く持ち運びに便利

・連続で10時間使用可能(自分は2時間程度の利用を予定していたので十分)

【悪かったこと、気になったこと】

5Gに対応していない(※自分の使い方的にはまったく不満はありません)

・0円をアピールされているけれどユニバーサルサービス料、電話リレーサービス料は毎月発生するのでまったくの0円ではない。たしかに注釈に小さく記載されているがこういうところが通信会社全般嫌いになる理由であることに気がつかないのかな。

・支払い方法にクレジットカードを選択した場合、カードの有効期限が切れる際には自分で支払い方法を切り替える必要がある。楽天モバイルからの事前通知はなく突然利用できなくなりなおかつ引き落としが出来ない旨のハガキがくるらしい、また引き落とし先変更時に手数料が発生するとのこと。

・銀行引き落としの場合は毎月手数料が発生するとのこと。

・料金は変更になる前後に事前通知や連絡はなくリミットを越えると料金が発生するとのこと、データチャージ機能があるのに提案もされることもないので使用データ量を考えながら自分でデータチャージ機能を活用する必要がある。(もっとユーザよりのサービス提供しないからイメージが悪くなる)

・ルータの製造メーカーが気になるかもしれない。あれだけニュースで話題にもなっているにも係わらず採用するのかと。(コスト優先ということかな)

【実際しようしてみ】

・ルータのSSID、パスワードをデフォルトから変更するためにはルーターの管理画面(http://192.168.0.1)にブラウザでアクセスする必要がりデフォルトパスワードは"admin"

・Chromebookから接続する際にQRコードをスキャンして接続させることは不可能、ただし一度接続させてしまえば次回から認証情報の入力は不要なので苦にはならない


なんか悪かったこと、気になることの方が多くじゃあ使用しないかというとスマフォのデータ通信料が少ないプランを使用している以上テザリングは難しく、なおかつChromebookを外で使用する頻度も少ない中でではこの楽天モバイルのプランが一番合っていると思っているのでしばくらは使い続けてみるつもりです。


2021年9月19日日曜日

【TensorFlow】Chromebook(ARM64)のLinux(Debian)にPython3.7+TensorFlow2.6.0+ keras

 Pandasのインストールも問題なく終わったので早速TensorFlowをインストールしようとpipコマンドで実行してみると。

pip install tensorflow

Defaulting to user installation because normal site-packages is not writeable

ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)

ERROR: No matching distribution found for tensorflow

対象のバージョンがない?

調べてみるとこういうケースはあるようでPtyhon3.7は以前は対応していなかったらしいですが調べていくうちに現在は対応していることは判明、一安心。

どうやら自分の環境に合うパッケージ(whl)ファイルをダウンロードしてインストールすれば良さそうということが分かりました。

■端末構成

ASUS Chromebook Detachable CM3

$cat /etc/issue
Debian GNU/Linux 10 \n \l

コードネームはbuster

$lscpu
Architecture:        aarch64
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           2
Vendor ID:           ARM
Model:               4
Model name:          Cortex-A53
Stepping:            r0p4
BogoMIPS:            26.00
Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid

Python 3.7.3 (default, Jan 22 2021, 20:04:44)

■numpyの最新化

ダウンロードするパッケージを選ぶ際にnumpyのバージョンらしい数字で分れていたので事前に最新化
・バージョン確認
$pip list --outdated
Package           Version Latest Type
----------------- ------- ------ -----
numpy             1.20.3  1.21.2 wheel

・バージョンアップ
$pip install --upgrade numpy

■ TensorFlowパッケージファイルダウンロード

ダウンロードサイト:https://github.com/PINTO0309/Tensorflow-bin

事前に調べたArchitectureとPythonのバージョンとnumpyのバージョンからtensorflow-2.6.0-cp37-none-linux_aarch64_numpy1211_download.shを選択

リンクからwhlファイルをダウンロードできるわけではなさそうで上記のshファイルをダウンロードするらしい。
ただダウンロード方法が分からずリンク先にあるshファイルのソースをコピーして適当に作成したローカルファイル(/tmp/download.sh)にソースをペースト

(https://github.com/PINTO0309/Tensorflow-binから引用) 

#!/bin/bash

curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=1XnV8W38HGW4PmENmfQA5-5NrQ84SsTqX" > /dev/null
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"
curl -Lb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=1XnV8W38HGW4PmENmfQA5-5NrQ84SsTqX" -o tensorflow-2.6.0-cp37-none-linux_aarch64.whl
echo Download finished.


download.shに実行権を付与した後download.shを実行して無事tensorflow-2.6.0-cp37-none-linux_aarch64.whlを入手

■TensorFlowインストール

さっそくインストールしてみると
pip install tensorflow-2.6.0-cp37-none-linux_aarch64.whl

(エラー)
Defaulting to user installation because normal site-packages is not writeable
Processing ./tensorflow-2.6.0-cp37-none-linux_aarch64.whl
Collecting h5py~=3.1.0
  Downloading h5py-3.1.0.tar.gz (371 kB)
     |████████████████████████████████| 371 kB 1.5 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Collecting tensorflow-estimator~=2.6
  Downloading tensorflow_estimator-2.6.0-py2.py3-none-any.whl (462 kB)
     |████████████████████████████████| 462 kB 2.3 MB/s
Collecting wheel~=0.35
  Using cached wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Collecting six~=1.15.0
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting clang~=5.0
  Downloading clang-5.0.tar.gz (30 kB)
Collecting keras-preprocessing~=1.1.2
  Downloading Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB)
     |████████████████████████████████| 42 kB 284 kB/s
Collecting flatbuffers~=1.12.0
  Downloading flatbuffers-1.12-py2.py3-none-any.whl (15 kB)
Collecting keras~=2.6
  Downloading keras-2.6.0-py2.py3-none-any.whl (1.3 MB)
     |████████████████████████████████| 1.3 MB 7.3 MB/s
Collecting gast==0.4.0
  Downloading gast-0.4.0-py3-none-any.whl (9.8 kB)
Collecting grpcio<2.0,>=1.37.0
  Downloading grpcio-1.40.0-cp37-cp37m-manylinux_2_24_aarch64.whl (39.2 MB)
     |████████████████████████████████| 39.2 MB 40 kB/s
Collecting termcolor~=1.1.0
  Downloading termcolor-1.1.0.tar.gz (3.9 kB)
Requirement already satisfied: numpy~=1.21.1 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (1.21.2)
Collecting opt-einsum~=3.3.0
  Downloading opt_einsum-3.3.0-py3-none-any.whl (65 kB)
     |████████████████████████████████| 65 kB 846 kB/s
Collecting absl-py~=0.10
  Downloading absl_py-0.13.0-py3-none-any.whl (132 kB)
     |████████████████████████████████| 132 kB 12.6 MB/s
Collecting typing-extensions~=3.7.4
  Downloading typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Collecting google-pasta~=0.2
  Downloading google_pasta-0.2.0-py3-none-any.whl (57 kB)
     |████████████████████████████████| 57 kB 1.3 MB/s
Collecting tensorboard~=2.6
  Downloading tensorboard-2.6.0-py3-none-any.whl (5.6 MB)
     |████████████████████████████████| 5.6 MB 10.0 MB/s
Collecting wrapt~=1.12.1
  Downloading wrapt-1.12.1.tar.gz (27 kB)
Collecting protobuf>=3.9.2
  Downloading protobuf-3.18.0-cp37-cp37m-manylinux2014_aarch64.whl (924 kB)
     |████████████████████████████████| 924 kB 10.7 MB/s
Collecting astunparse~=1.6.3
  Downloading astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Collecting cached-property
  Downloading cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB)
Collecting google-auth<2,>=1.6.3
  Downloading google_auth-1.35.0-py2.py3-none-any.whl (152 kB)
     |████████████████████████████████| 152 kB 11.5 MB/s
Collecting tensorboard-data-server<0.7.0,>=0.6.0
  Downloading tensorboard_data_server-0.6.1-py3-none-any.whl (2.4 kB)
Collecting setuptools>=41.0.0
  Using cached setuptools-58.0.4-py3-none-any.whl (816 kB)
Collecting tensorboard-plugin-wit>=1.6.0
  Downloading tensorboard_plugin_wit-1.8.0-py3-none-any.whl (781 kB)
     |████████████████████████████████| 781 kB 8.2 MB/s
Collecting werkzeug>=0.11.15
  Downloading Werkzeug-2.0.1-py3-none-any.whl (288 kB)
     |████████████████████████████████| 288 kB 8.9 MB/s
Collecting google-auth-oauthlib<0.5,>=0.4.1
  Downloading google_auth_oauthlib-0.4.6-py2.py3-none-any.whl (18 kB)
Collecting requests<3,>=2.21.0
  Downloading requests-2.26.0-py2.py3-none-any.whl (62 kB)
     |████████████████████████████████| 62 kB 154 kB/s
Collecting markdown>=2.6.8
  Downloading Markdown-3.3.4-py3-none-any.whl (97 kB)
     |████████████████████████████████| 97 kB 1.1 MB/s
Collecting pyasn1-modules>=0.2.1
  Downloading pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
     |████████████████████████████████| 155 kB 8.5 MB/s
Collecting rsa<5,>=3.1.4
  Downloading rsa-4.7.2-py3-none-any.whl (34 kB)
Collecting cachetools<5.0,>=2.0.0
  Downloading cachetools-4.2.2-py3-none-any.whl (11 kB)
Collecting requests-oauthlib>=0.7.0
  Downloading requests_oauthlib-1.3.0-py2.py3-none-any.whl (23 kB)
Collecting importlib-metadata
  Downloading importlib_metadata-4.8.1-py3-none-any.whl (17 kB)
Collecting pyasn1<0.5.0,>=0.4.6
  Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
     |████████████████████████████████| 77 kB 1.3 MB/s
Collecting certifi>=2017.4.17
  Downloading certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
     |████████████████████████████████| 145 kB 8.2 MB/s
Collecting charset-normalizer~=2.0.0
  Downloading charset_normalizer-2.0.6-py3-none-any.whl (37 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.2-py3-none-any.whl (59 kB)
     |████████████████████████████████| 59 kB 1.6 MB/s
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
     |████████████████████████████████| 138 kB 15.9 MB/s
Collecting oauthlib>=3.0.0
  Downloading oauthlib-3.1.1-py2.py3-none-any.whl (146 kB)
     |████████████████████████████████| 146 kB 1.6 MB/s
Collecting zipp>=0.5
  Downloading zipp-3.5.0-py3-none-any.whl (5.7 kB)
Building wheels for collected packages: clang, h5py, termcolor, wrapt
  Building wheel for clang (setup.py) ... done
  Created wheel for clang: filename=clang-5.0-py3-none-any.whl size=30705 sha256=965264867ac952ffe0cdcd7e9e4ec815662a7d5e09bd44b5542bf4283fab3ac9
  Stored in directory: /home/hoto/.cache/pip/wheels/98/91/04/971b4c587cf47ae952b108949b46926f426c02832d120a082a
  Building wheel for h5py (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /home/hoto/.local/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpjazixgh6
       cwd: /tmp/pip-install-r_317f6s/h5py_3678e278ecf34daf8f166a7050ac0992
  Complete output (69 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-3.7
  creating build/lib.linux-aarch64-3.7/h5py
  copying h5py/__init__.py -> build/lib.linux-aarch64-3.7/h5py
  copying h5py/h5py_warnings.py -> build/lib.linux-aarch64-3.7/h5py
  copying h5py/ipy_completer.py -> build/lib.linux-aarch64-3.7/h5py
  copying h5py/version.py -> build/lib.linux-aarch64-3.7/h5py
  creating build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/__init__.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/attrs.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/base.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/compat.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/dataset.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/datatype.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/dims.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/files.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/filters.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/group.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/selections.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/selections2.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/vds.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  creating build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/__init__.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/common.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/conftest.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_attribute_create.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_attrs.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_attrs_data.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_base.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_big_endian_file.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_completions.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dataset.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dataset_getitem.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dataset_swmr.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_datatype.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dimension_scales.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dims_dimensionproxy.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dtype.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_errors.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_file.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_file2.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_file_image.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_filters.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_group.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5d_direct_chunk.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5f.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5p.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5pl.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5t.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_objects.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_selections.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_slicing.py -> build/lib.linux-aarch64-3.7/h5py/tests
  creating build/lib.linux-aarch64-3.7/h5py/tests/data_files
  copying h5py/tests/data_files/__init__.py -> build/lib.linux-aarch64-3.7/h5py/tests/data_files
  creating build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/test_vds/__init__.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/test_vds/test_highlevel_vds.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/test_vds/test_lowlevel_vds.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/test_vds/test_virtual_source.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/data_files/vlen_string_dset.h5 -> build/lib.linux-aarch64-3.7/h5py/tests/data_files
  copying h5py/tests/data_files/vlen_string_dset_utc.h5 -> build/lib.linux-aarch64-3.7/h5py/tests/data_files
  copying h5py/tests/data_files/vlen_string_s390x.h5 -> build/lib.linux-aarch64-3.7/h5py/tests/data_files
  running build_ext
  Building h5py requires pkg-config unless the HDF5 path is explicitly specified
  error: pkg-config probably not installed: FileNotFoundError(2, "No such file or directory: 'pkg-config'")
  ----------------------------------------
  ERROR: Failed building wheel for h5py
  Building wheel for termcolor (setup.py) ... done
  Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4831 sha256=49219dc8d2a0984da0c4841b0c5e83788f3a3c4f55832a1f160a0443442de651
  Stored in directory: /home/hoto/.cache/pip/wheels/3f/e3/ec/8a8336ff196023622fbcb36de0c5a5c218cbb24111d1d4c7f2
  Building wheel for wrapt (setup.py) ... done
  Created wheel for wrapt: filename=wrapt-1.12.1-cp37-cp37m-linux_aarch64.whl size=72882 sha256=7d42f58dc8673df65fb0f65475d3cc0c5d9b5465a8410228b7998e619e588a89
  Stored in directory: /home/hoto/.cache/pip/wheels/62/76/4c/aa25851149f3f6d9785f6c869387ad82b3fd37582fa8147ac6
Successfully built clang termcolor wrapt
Failed to build h5py
ERROR: Could not build wheels for h5py which use PEP 517 and cannot be installed directly

失敗・・・。
どうやらh5py関連でエラーのようなのでエラーメッセージで検索し同じ様なケースの対応をとりあえず真似してみました。

これ以降はどれが正解だったのか分からずとりあえずやった内容を列挙


setuptoolsとwheelが古いとなる情報がありpip install --upgrade setuptools wheelでアップデート
→失敗

h5pyを単体で色々なオプションで試行
pip install --no-use-pep517 h5py
→失敗
pip install --no-binary h5py
→失敗
pip install --no-binary=h5py h5py
→失敗

pkg-configをインストール
#sudo apt list --installed | grep pkg-config
→失敗

debinのパッケージにh5pyがあるようなのでインストール
#sudo apt install python3-h5py
→バージョンが2.8.0-3となんか古そう

再度TensorFlowのインストールを試行

pip install tensorflow-2.6.0-cp37-none-linux_aarch64.whl

Defaulting to user installation because normal site-packages is not writeable
Processing ./tensorflow-2.6.0-cp37-none-linux_aarch64.whl
Collecting keras-preprocessing~=1.1.2
  Using cached Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB)
Collecting clang~=5.0
  Using cached clang-5.0-py3-none-any.whl
Collecting wrapt~=1.12.1
  Using cached wrapt-1.12.1-cp37-cp37m-linux_aarch64.whl
Collecting opt-einsum~=3.3.0
  Using cached opt_einsum-3.3.0-py3-none-any.whl (65 kB)
Collecting astunparse~=1.6.3
  Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Collecting tensorflow-estimator~=2.6
  Using cached tensorflow_estimator-2.6.0-py2.py3-none-any.whl (462 kB)
Collecting tensorboard~=2.6
  Using cached tensorboard-2.6.0-py3-none-any.whl (5.6 MB)
Collecting termcolor~=1.1.0
  Using cached termcolor-1.1.0-py3-none-any.whl
Collecting gast==0.4.0
  Using cached gast-0.4.0-py3-none-any.whl (9.8 kB)
Collecting flatbuffers~=1.12.0
  Using cached flatbuffers-1.12-py2.py3-none-any.whl (15 kB)
Requirement already satisfied: wheel~=0.35 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (0.37.0)
Collecting six~=1.15.0
  Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting keras~=2.6
  Using cached keras-2.6.0-py2.py3-none-any.whl (1.3 MB)
Collecting absl-py~=0.10
  Using cached absl_py-0.13.0-py3-none-any.whl (132 kB)
Collecting google-pasta~=0.2
  Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB)
Collecting grpcio<2.0,>=1.37.0
  Using cached grpcio-1.40.0-cp37-cp37m-manylinux_2_24_aarch64.whl (39.2 MB)
Collecting protobuf>=3.9.2
  Using cached protobuf-3.18.0-cp37-cp37m-manylinux2014_aarch64.whl (924 kB)
Collecting h5py~=3.1.0
  Using cached h5py-3.1.0.tar.gz (371 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Collecting typing-extensions~=3.7.4
  Using cached typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Requirement already satisfied: numpy~=1.21.1 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (1.21.2)
Collecting cached-property
  Using cached cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB)
Requirement already satisfied: setuptools>=41.0.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorboard~=2.6->tensorflow==2.6.0) (58.0.4)
Collecting google-auth<2,>=1.6.3
  Using cached google_auth-1.35.0-py2.py3-none-any.whl (152 kB)
Collecting requests<3,>=2.21.0
  Using cached requests-2.26.0-py2.py3-none-any.whl (62 kB)
Collecting google-auth-oauthlib<0.5,>=0.4.1
  Using cached google_auth_oauthlib-0.4.6-py2.py3-none-any.whl (18 kB)
Collecting werkzeug>=0.11.15
  Using cached Werkzeug-2.0.1-py3-none-any.whl (288 kB)
Collecting tensorboard-data-server<0.7.0,>=0.6.0
  Using cached tensorboard_data_server-0.6.1-py3-none-any.whl (2.4 kB)
Collecting markdown>=2.6.8
  Using cached Markdown-3.3.4-py3-none-any.whl (97 kB)
Collecting tensorboard-plugin-wit>=1.6.0
  Using cached tensorboard_plugin_wit-1.8.0-py3-none-any.whl (781 kB)
Collecting cachetools<5.0,>=2.0.0
  Using cached cachetools-4.2.2-py3-none-any.whl (11 kB)
Collecting rsa<5,>=3.1.4
  Using cached rsa-4.7.2-py3-none-any.whl (34 kB)
Collecting pyasn1-modules>=0.2.1
  Using cached pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
Collecting requests-oauthlib>=0.7.0
  Using cached requests_oauthlib-1.3.0-py2.py3-none-any.whl (23 kB)
Collecting importlib-metadata
  Using cached importlib_metadata-4.8.1-py3-none-any.whl (17 kB)
Collecting pyasn1<0.5.0,>=0.4.6
  Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
Collecting charset-normalizer~=2.0.0
  Using cached charset_normalizer-2.0.6-py3-none-any.whl (37 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.2-py3-none-any.whl (59 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
Collecting oauthlib>=3.0.0
  Using cached oauthlib-3.1.1-py2.py3-none-any.whl (146 kB)
Collecting zipp>=0.5
  Using cached zipp-3.5.0-py3-none-any.whl (5.7 kB)
Building wheels for collected packages: h5py
  Building wheel for h5py (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /home/hoto/.local/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpqu4eq5l4
       cwd: /tmp/pip-install-r22datm0/h5py_c83ebf6719484a6cb76ecd27971abef2
  Complete output (70 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-3.7
  creating build/lib.linux-aarch64-3.7/h5py
  copying h5py/__init__.py -> build/lib.linux-aarch64-3.7/h5py
  copying h5py/h5py_warnings.py -> build/lib.linux-aarch64-3.7/h5py
  copying h5py/ipy_completer.py -> build/lib.linux-aarch64-3.7/h5py
  copying h5py/version.py -> build/lib.linux-aarch64-3.7/h5py
  creating build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/__init__.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/attrs.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/base.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/compat.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/dataset.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/datatype.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/dims.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/files.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/filters.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/group.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/selections.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/selections2.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/vds.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  creating build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/__init__.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/common.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/conftest.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_attribute_create.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_attrs.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_attrs_data.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_base.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_big_endian_file.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_completions.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dataset.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dataset_getitem.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dataset_swmr.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_datatype.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dimension_scales.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dims_dimensionproxy.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dtype.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_errors.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_file.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_file2.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_file_image.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_filters.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_group.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5d_direct_chunk.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5f.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5p.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5pl.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5t.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_objects.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_selections.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_slicing.py -> build/lib.linux-aarch64-3.7/h5py/tests
  creating build/lib.linux-aarch64-3.7/h5py/tests/data_files
  copying h5py/tests/data_files/__init__.py -> build/lib.linux-aarch64-3.7/h5py/tests/data_files
  creating build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/test_vds/__init__.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/test_vds/test_highlevel_vds.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/test_vds/test_lowlevel_vds.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/test_vds/test_virtual_source.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/data_files/vlen_string_dset.h5 -> build/lib.linux-aarch64-3.7/h5py/tests/data_files
  copying h5py/tests/data_files/vlen_string_dset_utc.h5 -> build/lib.linux-aarch64-3.7/h5py/tests/data_files
  copying h5py/tests/data_files/vlen_string_s390x.h5 -> build/lib.linux-aarch64-3.7/h5py/tests/data_files
  running build_ext
  Loading library to get version: libhdf5.so
  error: Unable to load dependency HDF5, make sure HDF5 is installed properly
  error: libhdf5.so: cannot open shared object file: No such file or directory
  ----------------------------------------
  ERROR: Failed building wheel for h5py
Failed to build h5py
ERROR: Could not build wheels for h5py which use PEP 517 and cannot be installed directly

失敗・・・でもエラーメッセージが変わっているようで今度はlibhdf5関連

似た事象をインターネットで調べてversioned-hdf5をインストールしてみたけれど失敗・・・。

よくxx.soファイルがないのはコンパイルに必要なライブラリがない場合がおおいのでdebianパッケージのlibhdf5-devをインストールしてみる

#sudo apt install libhdf5-dev

TensorFlowのインストールを試行

pip install tensorflow-2.6.0-cp37-none-linux_aarch64.whl
Defaulting to user installation because normal site-packages is not writeable
Processing ./tensorflow-2.6.0-cp37-none-linux_aarch64.whl
Requirement already satisfied: six~=1.15.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (1.15.0)
Requirement already satisfied: grpcio<2.0,>=1.37.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (1.40.0)
Requirement already satisfied: protobuf>=3.9.2 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (3.18.0)
Requirement already satisfied: clang~=5.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (5.0)
Requirement already satisfied: keras~=2.6 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (2.6.0)
Requirement already satisfied: google-pasta~=0.2 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (0.2.0)
Requirement already satisfied: h5py~=3.1.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (3.1.0)
Requirement already satisfied: numpy~=1.21.1 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (1.21.2)
Requirement already satisfied: gast==0.4.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (0.4.0)
Requirement already satisfied: keras-preprocessing~=1.1.2 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (1.1.2)
Requirement already satisfied: wrapt~=1.12.1 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (1.12.1)
Requirement already satisfied: absl-py~=0.10 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (0.13.0)
Requirement already satisfied: opt-einsum~=3.3.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (3.3.0)
Requirement already satisfied: tensorflow-estimator~=2.6 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (2.6.0)
Requirement already satisfied: wheel~=0.35 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (0.37.0)
Requirement already satisfied: astunparse~=1.6.3 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (1.6.3)
Requirement already satisfied: flatbuffers~=1.12.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (1.12)
Requirement already satisfied: termcolor~=1.1.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (1.1.0)
Requirement already satisfied: typing-extensions~=3.7.4 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (3.7.4.3)
Requirement already satisfied: tensorboard~=2.6 in /home/hoto/.local/lib/python3.7/site-packages (from tensorflow==2.6.0) (2.6.0)
Requirement already satisfied: cached-property in /home/hoto/.local/lib/python3.7/site-packages (from h5py~=3.1.0->tensorflow==2.6.0) (1.5.2)
Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorboard~=2.6->tensorflow==2.6.0) (0.6.1)
Requirement already satisfied: setuptools>=41.0.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorboard~=2.6->tensorflow==2.6.0) (58.0.4)
Requirement already satisfied: requests<3,>=2.21.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorboard~=2.6->tensorflow==2.6.0) (2.26.0)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /home/hoto/.local/lib/python3.7/site-packages (from tensorboard~=2.6->tensorflow==2.6.0) (0.4.6)
Requirement already satisfied: werkzeug>=0.11.15 in /home/hoto/.local/lib/python3.7/site-packages (from tensorboard~=2.6->tensorflow==2.6.0) (2.0.1)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /home/hoto/.local/lib/python3.7/site-packages (from tensorboard~=2.6->tensorflow==2.6.0) (1.8.0)
Requirement already satisfied: markdown>=2.6.8 in /home/hoto/.local/lib/python3.7/site-packages (from tensorboard~=2.6->tensorflow==2.6.0) (3.3.4)
Requirement already satisfied: google-auth<2,>=1.6.3 in /home/hoto/.local/lib/python3.7/site-packages (from tensorboard~=2.6->tensorflow==2.6.0) (1.35.0)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in /home/hoto/.local/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.6->tensorflow==2.6.0) (4.2.2)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /home/hoto/.local/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.6->tensorflow==2.6.0) (0.2.8)
Requirement already satisfied: rsa<5,>=3.1.4 in /home/hoto/.local/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.6->tensorflow==2.6.0) (4.7.2)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /home/hoto/.local/lib/python3.7/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.6->tensorflow==2.6.0) (1.3.0)
Requirement already satisfied: importlib-metadata in /home/hoto/.local/lib/python3.7/site-packages (from markdown>=2.6.8->tensorboard~=2.6->tensorflow==2.6.0) (4.8.1)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /home/hoto/.local/lib/python3.7/site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard~=2.6->tensorflow==2.6.0) (0.4.8)
Requirement already satisfied: certifi>=2017.4.17 in /home/hoto/.local/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard~=2.6->tensorflow==2.6.0) (2021.5.30)
Requirement already satisfied: idna<4,>=2.5 in /home/hoto/.local/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard~=2.6->tensorflow==2.6.0) (3.2)
Requirement already satisfied: charset-normalizer~=2.0.0 in /home/hoto/.local/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard~=2.6->tensorflow==2.6.0) (2.0.6)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/hoto/.local/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard~=2.6->tensorflow==2.6.0) (1.26.6)
Requirement already satisfied: oauthlib>=3.0.0 in /home/hoto/.local/lib/python3.7/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.6->tensorflow==2.6.0) (3.1.1)
Requirement already satisfied: zipp>=0.5 in /home/hoto/.local/lib/python3.7/site-packages (from importlib-metadata->markdown>=2.6.8->tensorboard~=2.6->tensorflow==2.6.0) (3.5.0)
Installing collected packages: tensorflow
Successfully installed tensorflow-2.6.0

無事インストール成功!!

■kerasのインストール


pip install keras

Defaulting to user installation because normal site-packages is not writeable
Collecting keras
  Using cached keras-2.6.0-py2.py3-none-any.whl (1.3 MB)
Installing collected packages: keras
Successfully installed keras-2.6.0

すんなりインストール完了

とりあえずインストールは完了したけれど本当に使用できるか試してみないと。

【追記】

kerasを調べていてITmediaの記事を読んでやっと理解、kerasはtensorflow.kerasとしてTensorFlow2にで組み込まれたようです。なのでわざわざkerasをインストールする必要はなかったようです。







2021年9月17日金曜日

【scikit-learn】Linux(ベータ版)にpandasとscikit-learnのインストール

 numpyまではインストールしていましたが参考書を読み進みそろそろ機械学習のライブラリをしようすることになりそうなのでpandasとscikit-learnをインストールしました。

intel系のマシンならあまり心配ではないのですが使用しているChromeBook(Detachable CM3)で使用されているCPUはARM系なのでこういう計算系のライブラリのインストールが心配でした。

ただ、結果からいうととくに問題なくインストール完了です。


pipのupgradeしろと警告メッセージが表示していますがpandasとしては1.3.3がインストールされました。


scikit-learnも1.20.3が問題なくインストール完了

これで安心して勉強できます。

Chromebook の Linux コンテナ (Crostini) のバックアップ

Linux(ベータ版)は PythonやVisualStudioなどインストールして学習にかなり重宝しています。

さらに色々とPythonのライブラリのインストールもするのでいったんバックアップすることにしました。


バックアップ方法を紹介されているサイトを参考に実施、作業はいたって簡単


設定メニューからデベロッパーから「バックアップと復元」を選択しバックアップボタンをクリック


保存先と保存ファイル名を選択して保存ボタンをクリックするだけ


まだたいしてインストールをしていないからかバックアップファイルは1.6G程度でおおよそ10分ぐらいでバックアップ完了

Chromebookのストレージサイズはけして多くはないので自宅のNASに退避したのち削除、思っていた以上に簡単でした。

Linux自体は起動したままの状態だったのでちょっと気になりましたがなんの問題もなくバックアップもできその後もターミナルを起動してみましたが普通に使用できました。




2021年8月9日月曜日

Linux(ベータ版)にpipとScipyのインストール

 数理最適化(scipy.optimize)をする必要があり数値解析パッケージ(Scipy)をインストールすることに。

参考にしたサイトではpipコマンドを使用しており今後のことも考えてまずはpipをインストール


Chormebook上のLinux(ベータ版)のPythonはpython3なのについ癖でpythonと入力としてしまいます。

scipy(1.7.1)が問題なくインストールされました。

2021年7月3日土曜日

Error stating penguin container:51

 ChromebookのLinux(ベータ版)のターミナルを起動しようとしたら失敗


原因がわからずとりあえずChromeを再起動したら無事ターミナルは起動するようになったけれど調べてみるといがいにこの事象はでることがあるらしい。

その場合はターミナルのアイコンを右クリックしてLinuxを一度終了してターミナルをクリックすることでLinuxのコンテナを起動しなおせばいいらしい


croshに入ってターミナルを再起動する方法もあるらしい
chrome上でCtl+Alt+tでcroshに入る

リスト(list)でコンテナを確認
ターミナル(termina)を停止
ターミナルを起動

>vmc list
>vmc stop termina
>vmc start temina

シェルが表示されるのでexitで抜けてさらにexitでcroshを抜ける


2021年5月26日水曜日

matplotlibで日本語表示のためにIPAフォントをインストール

 Linux(ベータ版)を日本語化する際にデフォルトでNoto Sans CJK JP日本語フォントがインストールされていいたので日本語フォントは追加していませんでした。

しかし、パッケージでインストールしたmatplotlibはVer3.0.2のようでttcファイルに未対応(V3r3.1から対応したらしい)のようなので上記の日本語フォントが扱えないらしい。

Noto Sans CJK JPはttcファイル

仕方なくIPAフォントをインストールすることにしました。

■IPAフォントパッケージインストール

>sudo apt install fonts-ipaexfont

■インストールされたフォントの確認

 >fc-list | grep 'IPA'

(実行結果)
/usr/share/fonts/opentype/ipaexfont-gothic/ipaexg.ttf: IPAexゴシック,IPAexGothic:style=Regular
/usr/share/fonts/opentype/ipaexfont-mincho/ipaexm.ttf: IPAex明朝,IPAexMincho:style=Regular
/usr/share/fonts/truetype/fonts-japanese-mincho.ttf: IPAex明朝,IPAexMincho:style=Regular
/usr/share/fonts/truetype/fonts-japanese-gothic.ttf: IPAexゴシック,IPAexGothic:style=Regular

ttfファイルがインストールされました。

■Jypyter Notebookでのテストコード

import matplotlib.pyplot as plt
from matplotlib import rcParams
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif']  = ['IPAexGothic']
x = [1,2,3,4,5]
y=[2,4,6,8,10]
plt.plot(x,y)
plt.title('日本語タイトル')
plt.show()

無事日本語タイトルが表示できました。

2021年5月22日土曜日

matplotlibインストールでThe headers or library files could not be found for zlibエラー

 Chromebook(ASUS Chromebook Detachable CM3)上のLinux(ベータ版)の環境も整ってきたのでVisual Studio Codeの拡張機能Jupiter Notebookちょっと使用してみようとグラフ表示のサンプルコードを書いてみるとmatplotlibモジュールがないとエラー表示。

そんな気はしたのでインストールしようとすると関連モジュールのPillow-8.2でインストールエラー。

The headers or library files could not be found for zlib,

 a required dependency when compiling Pillow from source.

このメッセージは以前にも違う環境で発生したことが・・・あらためて調べてみると色々なケースがあるようで深みにはまりそうな予感。

公式サイトのインストール方法を読んでいるとdebianの場合、python3-pilとpython3-pil.imagetkのdebパッケージにPillowが含まれているような記載がありインストールしてみると5.4.1がインストールされました。

再度matplotlibのインストールをトライするとエラーは改善せず・・・インストールログをみているとPillowは6.2以上を使用するようでパッケージに含まれている5.4.1では古いらしい。(matplotlibは3.4.2をインストールしようとしていました)

もしかしてmatplotlibのdebパッケージがあるのではないかと調べて見るとやっぱりありました、バージョンは3.0.2とちょっと古いのですが勉強程度に使用する分ならきっと使えるのではないかと思うのでこれ以上深入りするのはやめました。

(2021/5/26)

matplotlibのTTCファイル対応は3.1からのようなので日本語表示させる場合はTTFファイルのインストールが必要そう



2021年5月21日金曜日

Visual Studio Code 1.56.0から1.56.2にアップデート

 Visual Studio Codeを使用していると左下のアイコンにマークが表示


どうやらアップデータが公開されたようです。Windows版であれば自動更新可能らしいのですがLinux版は手動更新が必要らしいです。


アップデート前のバージョン(1.56.0)を確認

上のアイコンをクリックしてみるとLinuxにインストールしてChromium(事前にインストールしていました)が起動しダウンロードサイトが表示

画面のリンクからdebファイルをダウンロードのリンクをクリック

Keepボタンをクリックしてダウンロードを継続


ダウンロードファイルはファイルアプリ側から参照可能なので新規インストールと同様にChromeOS側からダブルクリックしてインストールしてみると


エラーが発生・・・うーん。たまたまChromiumをインストールしていたのでダウンロードサイトを表示しましたが未インストール状態だったらどうなるのかな。ちなみにChromium上からダウンロードが完了したdebファイルのアイコンをクリックしてもインストールは開始されるもののエラーになりました。

とりあえずaptコマンドでインストールを試みてみることにしました。

なんとなくapt list --upgradeableでアップグレード可能なパッケージパッケージを確認してみるとちゃんとVisual Studio Codeが対象になっていました。

なので、sudo apt install codeで無事インストール完了

インストール後にバージョンを確認すると無事1.56.2にバージョンアップ完了、初めからコマンドにしておけばよかったです。


2021年5月19日水曜日

Visual Studio Codeのインストール

 無事日本語環境も整ったのでVisual Studio CodeをインストールしてPythonの開発環境を整えます。

PythonはLinux(データ版)には標準でインストールされているようです。

少し前はASUS Chromebook Detachable CM3に搭載されているCPUがARMベースMediaTekにVisual Studio Codeが対応していなかったようですが今はちゃんとサポートされているようで安心しました。


■パッケージのダウンロード

ダウンロードサイトからARM64版のdebパッケージをダウンロード

■インストール

ダウンロードしたdevファイルをChromeOSのファイルアプリでダブルクリック




LinuxアプリグループにVisual Studio Codeのアイコンが追加されます

■日本語化



左側メニューの拡張機能をクリックしてjapanをキーワードにして検索、
Japanese Language Pack for Visual Studio Codeを選択してクリックしインストールします。
Visual Studio Codeの再起動を求められるので再起動すると日本語表示になります。

■Python拡張機能

日本語化と同様にPython拡張機能をインストール

インストール自体はこれで完了、ChromeOS上からちゃんとLinuxにインストールしてくれるのは以外でした。

Visual Studio Codeのパッケージ名はcodeのようなのでターミナルからaptコマンドでインストールするならsudo apt install codeなのかな、その場合アイコンは作成されるのだろうか。。。

2021年5月13日木曜日

ChromebookのLinux(ベータ版)日本語環境(日本語入力)

Linux(ベータ版)も無事動作しているのでこの後インストールする予定のVisual Studio Codeのためにも日本語化(日本語入力)をできるようにしてみることに。

ざっと調べてみるとfcitxとMozcの組合せが多かったのでまずはこれで試してみました。

■タイムゾーンを確認

>timedatectl status


デフォルトで東京になっていることを確認

■ロケール

・ロケールパッケージ追加


日本のロケール情報がなさそうなのでパッケージを追加(※画像はパッケージを追加せずにロケール設定をした後にコマンドを実行したところ3行エラーが発生している)

>sudo apt install locales-all

・ロケール設定

>sudo localectl set-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja"

>source /etc/default/locale

■フォント

参考サイトではIPAフォントをインストールする手順が多いようですがfc-listコマンドで確認してみるとGoogleがAdobeと共同開発したフォントファミリーのNoto Sansがインストールされてるようなのでとりあえず追加はしないでおきました。


fc-listコマンド結果


■Mozc日本語入力システム(IME)

・インストール

>sudo apt install fcitx-mozc

インプットメソッドフレームワークであるfcitxは既にインストール済(?)だったのかとくにインストールはしませんでした。

・環境設定

/etc/systemd/user/cros-garcon.service.d/cros-garcon-override.confに以下の行を追加

Environment="GTK_IM_MODULE=fcitx"

Environment="QT_IM_MODULE=fcitx"

Environment="XMODIFIERS=@im=fcitx"

・自動起動設定

使用しているウィンドウマネージャー(sommelier)の設定ファイル(?)に追加

>echo "/usr/bin/fcitx-autostart" >> ~/.sommelierrc


・再起動

シェルフのターミナルアイコンを右クリックしてLinux(ベータ版)を終了、再度ターミナルを起動

■fcitxの設定

fcitxの設定ツール起動

>fcitx-configtool

起動直後の画面

1行目のKeyboard - English(US)は削除(一行目を選択した状態で画面左下の"-"をクリック)してKeyboard - Japaneseを追加(左下の"+"をクリックしてJapaneseを選択)して1行目に移動させます
削除、追加、移動後の状態

・入力設定
日本語入力時にカーソルがある位置にリアルタイムで入力できるようにする設定、アドオンタブでAdvancedチェックボックスをオン


左下のAdvancedチェックボックスをオンにした状態

Fctix XIM Frontendを選択して”設定”ボタンかダブルクリック
”XIMでOn The Spotスタイルを使う(起動中は変更できません)”チェックボックスをオン
OKボタンをクリック

・補足1

fcitx-configtoolを起動した際に以下のエラーメッセージが表示
----------------------------------- エラーメッセージここから
hoto@penguin:~$ fcitx-configtool

(process:612): Gtk-WARNING **: 17:36:30.344: Locale not supported by C library.
        Using the fallback 'C' locale.
xkbcommon: ERROR: Key "<CAPS>" added to modifier map for multiple modifiers; Using Mod3, ignoring Lock
----------------------------------- ここまで

この時はロケールパッケージを追加しないでロケールを日本に設定したのが原因、起動はしたもののメニューは日本語表示せず

・補足2

----------------------------------- エラーメッセージはここから
xkbcommon: ERROR: Key "<CAPS>" added to modifier map for multiple modifiers; Using Mod3, ignoring Lock
----------------------------------- ここまで
CAPSキーが云々、CM3のキーボードは87日本語キーボードだけれどロケールでキーボードレイアウト設定をしていないのが原因かも、だた設定作業には支障なかったので今回は無視しました。

■動作確認

標準のターミナルからではLinux上の日本語入力が出来ないのでとりあえずGoogleが公開しているオープンソースブラウザchromiumをインストールして起動させた状態で日本語入力ができることを確認しました。


chromiumを起動してCtrl+Spaceで日本語入力に切り替わることを確認できまいた。

・補足

chromiumはターミナル上からインストールしましたがLinuxアプリにchromiumのアイコンが作成されていました。

>sudo apt install chromium 



日本語環境も無事整ったので次は開発環境

2021年5月10日月曜日

テキストエディタ(Caret Mod)

 Caret Modはオフラインでも使用可能ということなのでインストールしておきました。

インストール後はテーマなど少し設定変更、メニューの設定→環境変数をクリックするとuser.jsonファイルが開き設定変更可能で変更を保存するとすぐに反映されるようです。


【変更点】

・テーマ

  "defaultTheme": "pronama_dark"→"defaultTheme": "pastel_on_dark"

・80文字の場所に目安線を表示

"showMargin": false→"showMargin": true

・インデント

"indentation": 2→"indentation": 4

・タブ切り替え時にリロードしない

 "disableReload": false → "disableReload": true

------ 2021/05/21追記 ------

 起動の際に前回終了時タブ状態を再現するのを無効にする起動

"disableTabRestore":false→ "disableTabRestore":true


2021年5月9日日曜日

ChromebookでLinux(ベータ版)初め

 Chromebookを使用してみたかった一つであるLinuxコンテナのCrostini

Linuxを純粋にChromebookにインストールしてデュアルブートさせるとかもあるけれどまずはお気軽なCrostiniを使用し始めました。

検索するとCrostini上のLinuxのことなのかピュアなLinuxなのかが混乱しそうになりました、また使用しているchromebookはASUS Chromebook Detachable CM3で動作リストにまだ記載がなくちょっと心配にもなりましたが有効化している方がいたので一安心

■Linux開発環境(ベータ版)の有効化


設定から詳細設定→デベロッパーにあるLinux開発環境(ベータ版)のオンにするをクリック


セットアップが開始


Linux上に作成されるユーザー名を任意に指定します、ディスクサイズ説明もあるように後で変更できるようなのでとりあえずデフォルトのまま

ダウンロードが数分かかりインストールされます。


インストールが完了すると自動的にターミナルが起動します、ここまでで10分もかからず終了

使用できるLinuxは2021/5/時点ではDebian GNU/Linux10(buster)でした。aarch64であることからこのChromebookはARMv8ベースなのが分かります。

■パッケージを最新化

・パッケージ情報の最新化

>sudo apt-get update

・実際にOSアップグレード(dist-upgradeでパッケージ構成の変更に追随してアップグレード)

>sudo apt-get dist-upgrade


今後色々使用していく上でもパッケージを最新化しておきました。


次は日本語化


ファイル共有へのアクセス

 Macとのファイル共有をしたくiOSならAirDropというとても便利な機能があるけれどChromeOSでは使えない。

外部ストレージサービスを使うのが一番簡単かもしれないけれど自宅にはNASもありどうせならNASを使用した方が便利

調べて見るとWindows共有(SMB)にアクセスするソフトもあるようだけれどどうやら標準のファイルアプリでも接続できるらしい




ファイルアプリのメニュー→サービス→SMBファイル共有を選ぶと自動でネットワーク上の共有情報を検索表示してくれたので認証情報を入力すればマウント完了(左側のGoogleドライブ下あたりに共有名のアイコンが表示する)

接続を解除したい場合は共有名のアイコンをクリック→ダブルタップ→閉じるを選択する。

簡単に接続できて便利。

2021年5月6日木曜日

タッチ感が悪いのでサラサラ保護シートを貼ることに

 基本的に普段使用しているMacも持ち出したりしないので保護シートをしていませんが、ASUS Chromebook Detachable CM3のディスプレイを指でなぞると滑りが今イチ気に入らない。

なんかペトペト?ペッタリな感じ。

仕方なく感触をよくするために保護シートを貼ることに、ただ買いに行った量販店には画面サイズに合うシートがなく結局ELECOMの11.6インチ用を購入して自分で適当なサイズにカット

貼ったおかげでタッチ感は快適、でも実はそれほど外面をタッチしないので2,000円近くの出費はちょっと微妙・・・。

2021年5月5日水曜日

Twitterクライアント

 Chromebookで使用するTwitterクライアントは複数ありどれも便利そうだけれどとりあえず基本的なことできれば十分なので過去に使用したことがあるTweetDeckにしてみました。

デフォルトは4カラム(列)表示ですが画面サイズがそこまで大きくないのでとりあえず不要なトレンドタグの列は削除してしようすることに。

今まで使用してタブレットでのTwitterクライアントに比べて若干動作が遅く感じもしますがまぁストレスを感じるレベルではないので不満はありません。

アプリそのものは日本語化されていないですが説明サイトもあるのでそれほど困ることはないのかな。

次はどのアプリをインストールしようかな。

2021年5月4日火曜日

シェルフ位置を左右に変更

 シェルフはデフォルトが下部にあるけれど縦幅をなるべく確保したいので左右に変更することにしまいた。



シェルフをダブルダップしてシェルフ位置の変更から左右好きな方に変更可能らしいので自分はWindowsのなごりもありとりあえず左することにしました。

2021年5月2日日曜日

タッチパッドの上下スクロールの逆スクロールを有効化

ChromeBookを操作していてなにか違和感を感じていてふと気がついたのが タッチパッドの上下スクロールが普段使用しているMacと逆にスクロールすること。

検索してみるとちゃんと逆スクロールできることがわかり一安心


設定⇢デバイス⇢タッチパッド⇢逆スクロールを有効にする。

Chromebookを使い始め

 今までブログを書くのはキーボードが必須なのでMacを使用していたけれどChormebookからでもいいかも、少なくともiPhoneやタブレットからは入力が面倒なので書いていませんでした。

今回もキーボードに慣れるためにChormebooで書いているけれど予想以上に打ちやすいかも、安いからと言ってLenovoにしなくて正解だったかも。

とりあえずChormebookの初期セットアップはすんなり完了したけれど、インターネット接続設定でDHCPが前提になっているのはどうなのかな、自宅の環境はDHCPを有効にしていたので自然に繋がったけれどそうでない場合はいきになりハマりそう。

あと最初にアカウントの入力を求められるけれど何のアカウントぐらいはもう少し説明してほしい。

さて、少しずつ使いやすいようにカスタマイズしていかないとな。