Python pip 命令不識別


pip安裝之后是command not found!

[root@bosonyun ~]#  pip
-bash: pip: command not found

仔細分析一下,因為重新編譯過python,我重新安裝的python的bin目錄不在$PATH中。

這就導致了‘command not found’

解決方法:

本地環境shell是bash,所以我就直接修改.bashrc 文件

[root@bosonyun bin]# export PATH=/usr/local/python2.7/bin:$PATH
[root@bosonyun bin]# echo $PATH
/usr/local/python2.7/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

最后,執行source命令,更新PATH。

source ~/.bashrc  

 再次嘗試pip 命令

[root@bosonyun /]# pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
pip (9.0.1)
setuptools (0.6rc11)
wheel (0.29.0)

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM