जब मैं करता हूं
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?
hash -t pip3प्रिंट्स/usr/bin/pip3
typeहीर का उपयोग करना चाहिए which। typeएक पॉज़िक्स शेल में बनाया गया है और आपको बताता है कि शेल क्या करेगा, इसके बजाय whichयह अनुमान लगाने की कोशिश करता है कि शेल क्या करेगा।
/usr/local/bin/pip3?