python pip3 install,brew install python3没有安装pip3

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:

brew install python3

This installed python3 but threw an error at the end saying it couldn't link python3 and prompted me to run

brew link python3

to link the installation but this throws another error:

Linking /usr/local/Cellar/python3/3.6.3... Error: Permission denied @ dir_s_mkdir - /usr/local/lib

Does anyone know how solve this ?

When I run:

brew info python3

It says:

==> 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

Which makes me think pip3 is installed but not recognized. Any help is appreciated.

INFO:

OS => MacOS High Sierra 10.13.1

pip3 install twilio

-bash: pip3: command not found

解决方案

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

🍺 /usr/local/Cellar/python3/3.6.3: 3,588 files, 56.1MB

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值