How can I install Python's pip3 on my Mac?

前端 未结 11 1797
春和景丽
春和景丽 2020-12-07 10:05

I\'m trying to install pip3, but I\'m not having any luck. Also, I tried sudo install and it did not work. How could I install pip3 on my Mac?



        
相关标签:
11条回答
  • 2020-12-07 10:39

    Python 3 was working successfully, but without pip3. I tried advice from Stack Overflow, Quora and others (numerous installs and uninstalls).

    Python 3 was always fine, but without pip3. Finally I downloaded Python3 from: https://www.python.org/downloads/

    By simple mouse clicks and everything (Python 3 + pip3), it is working fine now.

    0 讨论(0)
  • 2020-12-07 10:43

    If you're using Python 3, just execute python3 get-pip.py . It is just a simple command.

    0 讨论(0)
  • 2020-12-07 10:44

    After upgrading to macOS v10.15 (Catalina), and upgrading all my vEnv modules, pip3 stopped working (gave error: "TypeError: 'module' object is not callable").

    I found question 58386953 which led to here and solution.

    1. Exit from the vEnv (I started a fresh shell)
    2. sudo python3 -m pip uninstall pip (this is necessary, but it did not fix problem, because it removed the base Python pip, but it didn't touch my vEnv pip)
    3. sudo easy_install pip (reinstalling pip in base Python, not in vEnv)
    4. cd to your vEnv/bin and type "source activate" to get into vEnv
    5. rm pip pip3 pip3.6 (it seems to be the only way to get rid of the bogus pip's in vEnv)
    6. Now pip is gone from vEnv, and we can use the one in the base Python (I wasn't able to successfully install pip into vEnv after deleting)
    0 讨论(0)
  • 2020-12-07 10:45

    I solved the same problem with these commands:

    curl -O https://bootstrap.pypa.io/get-pip.py
    sudo python3 get-pip.py
    
    0 讨论(0)
  • 2020-12-07 10:48

    For me brew postinstall python3 didn't work. I found this solution on the GitHub Homebrew issues page:

    $ brew rm python
    $ rm -rf /usr/local/opt/python
    $ brew cleanup
    $ brew install python3
    
    0 讨论(0)
  • 2020-12-07 10:48

    Similar to Oksana but add python3

    $ brew rm python 
    $ brew rm python3 
    $ rm -rf /usr/local/opt/python
    $ rm -rf /usr/local/opt/python3
    $ brew prune 
    $ brew install python3
    $ brew postinstall python3
    

    Seem now work for pip3 under mac os x 10.13.3 Xcode 9.2

    0 讨论(0)
提交回复
热议问题