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)