opthub-org / opthub-client

CLI tools used in OptHub competitions.
https://pypi.org/project/opthub_client/
1 stars 0 forks source link

homebrewのトラブルシューティング #127

Open Mishima-Ryuji opened 3 months ago

Mishima-Ryuji commented 3 months ago

by @rikuhidaka

homebrewを使用していると、pipが使えずpipxを使う必要がある。仮想環境を使用しているとpip installした後にoptコマンドのパスが通ってない場合がある(全員の環境で起きるかはわからない)。自分の環境ではpipx ensurepathと~/.zshrcの実行が必要だった

➜  ~ python3 -m venv opthub-test
➜  ~ pipx install opthub-client --force
Installing to existing venv 'opthub-client'
  installed package opthub-client 0.3.0, installed using Python 3.12.5
  These apps are now globally available
    - opt
⚠️  Note: '/Users/rikuhidaka/.local/bin' is not on your PATH environment variable. These apps will not be globally accessible until your PATH is updated. Run `pipx ensurepath` to automatically add it,
    or manually modify your PATH in your shell's config file (e.g. ~/.bashrc).
done! ✨ 🌟 ✨
➜  ~ opt login
zsh: command not found: opt
➜  ~ pipx ensurepath
Success! Added /Users/rikuhidaka/.local/bin to the PATH environment variable.

Consider adding shell completions for pipx. Run 'pipx completions' for instructions.

You will need to open a new terminal or re-login for the PATH changes to take effect. Alternatively, you can source your shell's config file with e.g. 'source ~/.bashrc'.

Otherwise pipx is ready to go! ✨ 🌟 ✨
➜  ~ opt login      
zsh: command not found: opt
➜  ~ source ~/.bashrc
source: no such file or directory: /Users/rikuhidaka/.bashrc
➜  ~ source ~/.zshrc
➜  ~ opt login       
Username: