私がする時
which pip3
私は得る
/usr/local/bin/pip3
しかし、実行しようとするpip3と、次のようなエラーが表示されます。
bash: /usr/bin/pip3: No such file or directory
これは、最近そのファイルを削除したためです。今whichの別のバージョンへのコマンドポイントpip3それはに位置しています/usr/local/binが、シェルはまだ間違ったパスを記憶しています。そのパスを忘れさせるにはどうすればよいですか?
whichマニュアルは述べています
which returns the pathnames of the files (or links) which would be executed in the current environment, had its arguments been given as commands in
a strictly POSIX-conformant shell. It does this by searching the PATH for executable files matching the names of the arguments. It does not follow
symbolic links.
/usr/local/binと/usr/binは両方ともPATH変数にあり/usr/local/bin/pip3、シンボリックリンクではなく、実行可能ファイルです。なぜ実行されないのですか?
以前
—
エリックルヌーフ
pip3にそのシェルで実行して/usr/binから移動したことがありますか?
実行すると何が見えます
—
エリックルヌーフ
hash -t pip3か?
@Eric Renouf
—
-spiderface
hash -t pip3プリント/usr/bin/pip3
type特別な理由がない限り、常にを使用する必要がありますwhich。typeposixシェルに組み込まれwhich、シェルが何をするかを推測するのではなく、シェルが何をするかを示します。
/usr/local/bin/pip3何ですか?