no pip3 in or bash: pip3: command not found ...

1、whereis python3

[wcy@localhost ~]$ whereis python3
python3: /usr/bin/python3 /usr/local/python3
[wcy@localhost ~]$ cd /usr/local/python3
[wcy@localhost python3]$ ls
bin  include  lib  share
[wcy@localhost python3]$ cd bin
[wcy@localhost bin]$ ls
2to3              f2py     idle3    pip3.6    python3.6          python3-config
2to3-3.6          f2py3    idle3.6  pydoc3    python3.6-config   pyvenv
easy_install      f2py3.6  pip      pydoc3.6  python3.6m         pyvenv-3.6
easy_install-3.6  flask    pip3     python3   python3.6m-config  wheel

2, the locate PIP3
3, establish a flexible connection

[wcy@localhost ~]$ locate pip3
/usr/local/python3/bin/pip3.6
[wcy@localhost ~]$ sudo ln -s /usr/local/python3/bin/pip3.6 /usr/local/bin/pip3[wcy@localhost ~]$ pip3

Usage:   
  pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.

sudo: pip: command not found

Solution

[wcy@localhost ~]$ sudo vi  .bashrc
2、在末尾添加,保存退出
[wcy@localhost ~]$  alias sudo='sudo env PATH=$PATH'
    
[wcy@localhost ~]$  source ~/.bashrc

Guess you like

Origin blog.csdn.net/weixin_42185136/article/details/90636750