1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[macOS] インストールしたのに "command not found" になった場合のパスの通し方

Posted at

はじめに

Homebrewでパッケージをインストールしたのにパスが通ってなくて、解決までに時間がかかったので、その解決法を簡単にまとめました。

問題

HomebrewでPythonをインストールしたのに「zsh: command not found: python3」と表示されてしまう。

解決方法

Homebrewでインストールしたパッケージの実行ファイルは「/usr/local/bin」に格納されています。ここで、「.zshrc」ファイルを開いて、以下の内容を一番下に追記して保存します。

export PATH=$PATH:"/usr/local/bin/"

次に、以下のコマンドを実行し、バージョンが表示されたら成功です。

python3 --version

もしダメだったら、以下のコマンドを実行して「.zshrc」ファイルを再読み込みしてみてください。

source ~/.zshrc

おわりに

この記事が少しでも誰かの役に立てば嬉しいです。

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?