rangerはTUIのファイラ。
ranger
pip(失敗)
pip install ranger
error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. 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. For more information visit http://rptl.io/venv note: 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. hint: See PEP 668 for the detailed specification.
pipx
まずは以下手順でpipxをインストールする。
pipx run --spec ranger-fm ranger
実行
実行するときも以下コマンドを使う。(長い)
pipx run --spec ranger-fm ranger
version
$ pipx run --spec ranger-fm ranger --version ranger version: ranger 1.9.4 Python version: 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0] Locale: ja_JP.UTF-8
help
$ pipx run --spec ranger-fm ranger --help Usage: ranger [options] [path] Options: --version show program's version number and exit -h, --help show this help message and exit -d, --debug activate debug mode -c, --clean don't touch/require any config files. --logfile=file log file to use, '-' for stderr --cachedir=dir change the cache directory. (/home/pi/.cache/ranger) -r dir, --confdir=dir change the configuration directory. (/home/pi/.config/ranger) --datadir=dir change the data directory. (/home/pi/.local/share/ranger) --copy-config=which copy the default configs to the local config directory. Possible values: all, rc, rifle, commands, commands_full, scope --choosefile=OUTFILE Makes ranger act like a file chooser. When opening a file, it will quit and write the name of the selected file to OUTFILE. --choosefiles=OUTFILE Makes ranger act like a file chooser for multiple files at once. When opening a file, it will quit and write the name of all selected files to OUTFILE. --choosedir=OUTFILE Makes ranger act like a directory chooser. When ranger quits, it will write the name of the last visited directory to OUTFILE --selectfile=filepath Open ranger with supplied file selected. --show-only-dirs Show only directories, no files or links --list-unused-keys List common keys which are not bound to any action. --list-tagged-files=tag List all files which are tagged with the given tag, default: * --profile Print statistics of CPU usage on exit. --cmd=COMMAND Execute COMMAND after the configuration has been read. Use this option multiple times to run multiple commands.
以上。自作スクリプトのコードを変えなきゃ。