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

后端 未结 7 1151
伪装坚强ぢ
伪装坚强ぢ 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:27

    Since you have specified in the comments you want syntax like pip install [package] to work, here is a solution:

    1. Install setuptools for Python3: apt-get install python3-setuptools

    2. Now pip for Python3 could be installed by: python3 -m easy_install pip

    3. Now you can use pip with the specific version of Python to install package for Python 3 by: pip-3.2 install [package]

提交回复
热议问题