How to change pip3 command to be pip?

前端 未结 9 2484
梦毁少年i
梦毁少年i 2020-12-04 23:33

I uninstalled pip, and I installed pip3 instead. Now, I want to use pip3 by typing pip only. The reason is I am used to t

9条回答
  •  北海茫月
    2020-12-04 23:52

    You can write pip for pip3 after changing bashrc file in the home directory.

    In mac -

    Open bashrc file -

    vim ~/.bashrc
    

    Add this line at the end of the file -

    alias pip="pip3"
    

    Close the file. Don't forget to source this file in the terminal by

    source ~/.bashrc
    

    You are good to go. Now, whenever you will use pip in any command. it will be interpreted as pip3

    You can check it by running the command -

    pip --version
    

提交回复
热议问题