我使用 homebrew 安装了 python3 但它没有安装 pip3 或者我应该说它已安装但它无法识别该命令?
这是我所做的:
brew install python3
这安装了 python3 但最后抛出了一个错误,说它无法链接 python3 并提示我运行
brew link python3
链接安装,但这会引发另一个错误:
Linking /usr/local/Cellar/python3/3.6.3... Error: Permission denied @ dir_s_mkdir - /usr/local/lib
有谁知道如何解决这个问题?
当我跑步时:
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 <package>
They will install into the site-package directory
/usr/local/lib/python3.6/site-packages
See: https://docs.brew.sh/Homebrew-and-Python.html
这让我认为 pip3 已安装但未被识别。任何帮助表示赞赏。
INFO:
操作系统 => MacOS High Sierra 10.13.1
pip3 install twilio
-bash: pip3: command not found
好吧,我花了很多时间谷歌搜索,但问题是在高山脉中 usr/local 内的所有权限都发生了变化,并且自制程序必须在 usr/local 内创建一些文件夹。这是我解决所有问题的方法:
我尝试使用sudo brew install python3
但这也引发了错误
直接来自 Homebrew 告诉我它不允许使用sudo brew
.
使用 sudo mkdir 在 /usr/local 中创建我需要的文件夹:
sudo mkdir lib
sudo mkdir Frameworks
更改 /usr/local 内的权限,以便 homebrew 可以访问它们:
sudo chown -R $(whoami) $(brew --prefix)/*
现在安装python3
brew install python3
这将使您安装成功:
==> 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 <package>
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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)