brew install python3 didn't install pip3

前端 未结 5 2054
青春惊慌失措
青春惊慌失措 2021-01-31 04:18

I installed python3 using homebrew but it didn\'t install pip3 or should I say it installed but it doesn\'t recognize the command ?

Here is what I did:

b         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-31 04:54

    Ok it took me a lot of googling but the problem is that in high sierra all permissions inside usr/local changed and homebrew has to create some folder inside usr/local. Here is how I solved everything:

    I tried using sudo brew install python3 but that also threw an error directly from Homebrew telling me that it doesn't allow the use of sudo brew.

    Create the folders I needed using sudo mkdir inside /usr/local:

    sudo mkdir lib 
    sudo mkdir Frameworks
    

    Change the permissions inside /usr/local so that homebrew can access them:

    sudo chown -R $(whoami) $(brew --prefix)/*
    

    Now install python3

    brew install python3
    

    This will give you a successful installation:

    ==> Pouring python3-3.6.3.high_sierra.bottle.tar.gz
    ==> /usr/local/Cellar/python3/3.6.3/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python3/3.6.3/bin --in
    ==> /usr/local/Cellar/python3/3.6.3/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python3/3.6.3/bin --in
    ==> /usr/local/Cellar/python3/3.6.3/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python3/3.6.3/bin --in
    ==> Caveats
    Pip, setuptools, and wheel have been installed. To update them
      pip3 install --upgrade pip setuptools wheel
    
    You can install Python packages with
      pip3 install 
    
    They will install into the site-package directory
      /usr/local/lib/python3.6/site-packages
    
    See: https://docs.brew.sh/Homebrew-and-Python.html
    ==> Summary
    

提交回复
热议问题