How to override the pip command to Python3.x instead of Python2.7?

后端 未结 7 1186
伪装坚强ぢ
伪装坚强ぢ 2020-12-02 20:07

I am using OSX and I have pip installed for both Python3.5 and Python2.7. I know I can run the command pip2 to use Python2 and when I use the command pip3

7条回答
  •  心在旅途
    2020-12-02 20:39

    I always just run it via Python itself, this way:

    python3 -m pip install some_module
    

    or

    python2 -m pip install some_module
    

    The -m calls the __main__.py module of a specified package. Pip supports this.

提交回复
热议问题