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

前端 未结 11 1806
春和景丽
春和景丽 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: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)

提交回复
热议问题