PyGObjectのインストールエラーを回避する方法

pipコマンドで PyGObjectをインストールしようとすると

$ pip3 install  PyGObject

以下のエラーが出る場合がある

Package gobject-introspection-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gobject-introspection-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gobject-introspection-1.0' found
Command '('pkg-config', '--print-errors', '--exists', 'gobject-introspection-1.0 >= 1.46.0')' returned non-zero exit status 1.
  
Try installing it with: 'sudo apt install libgirepository1.0-dev'
----------------------------------------
ERROR: Failed building wheel for PyGObject
Running setup.py clean for PyGObject
Failed to build PyGObject
ERROR: Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly

エラーメッセージを読むと

Try installing it with: 'sudo apt install libgirepository1.0-dev'

と書いてあるように,aptで

$ sudo apt install libgirepository1.0-dev

libgirepository1.0-dev というパッケージをインストールしてから,再度

$ pip3 install  PyGObject

を実行すればこのエラーは回避できる

Windowsのドライブ(vfat)で rsync を正しく使う方法

vfat形式のドライブ(USBメモリなど)や,sambaなどでネットワーク経由でマウントしたストレージに対して rsync を使う場合は,いくつかオプションつけないと rsync の本来の性能が発揮されません.

rsyncの特徴,例えば差分コピーによる高速ファイルコピーなどを期待している場合は,次のようにオプションを付与すべきです.

rsync -a --no-o --no-p --no-g --safe-links --modify-window 1 --stats コピー元 コピー先

各オプションの意味は以下の通りです

--no-o
no owners の略です.vfatは owner つまり所有者の情報を保持できないので,このオプションで所有者情報を無視するようにします
--no-g
no groups の略です.vfatは group の情報も保持できないので,無視します.
--no-p
no permissions の略です.vfatはパーミッション情報も保持できないので,無視します.
--modify-window 1
rsyncはファイルの新旧を比較する際にファイルのタイムスタンプ情報を調べます.ところが vfat のタイムスタンプは2秒単位でしか変化しない(=タイムスタンプは2秒の解像度しか持ちません)ので,"--modify-window 1"をつけることで1秒未満のタイムスタンプのズレは無視するように設定します.
--safe-links
vfatはシンボリックリンクの機能を持っていません."--safe-links"をつけると,コピー元に含まれるシンボリックリンクはコピー対象外になります(無視されます)