我使用 Homebrew 软件安装了python3,但未安装pip3,还是应该说已安装了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
它说:
==> 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已安装但未被识别。任何帮助表示赞赏。
信息:
操作系统=> MacOS High Sierra 10.13.1
pip3 install twilio
-bash: pip3: command not found
最佳答案
好的,我花了很多时间进行谷歌搜索,但是问题是,在高塞拉利昂中,usr/local内的所有权限都已更改,而 Homebrew 软件必须在usr/local内创建一些文件夹。这是我解决所有问题的方法:
使用/usr/local中的sudo mkdir创建我需要的文件夹:
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
关于python - brew install python3没有安装pip3,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/47255517/