brew install python3 没有安装pip3

新手上路,请多包涵

我使用自制软件安装了 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

它说:

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

原文由 Alexander Luna 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1.6k
2 个回答

好吧,我花了很多时间谷歌搜索,但问题是在 high sierra 中,usr/local 中的所有权限都发生了变化,自制软件必须在 usr/local 中创建一些文件夹。这是我解决所有问题的方法:

我尝试使用 sudo brew install python3 但这也直接从 Homebrew 中抛出错误,告诉我它不允许使用 sudo brew

在 /usr/local 中使用 sudo mkdir 创建我需要的文件夹:

 sudo mkdir lib
sudo mkdir Frameworks

更改 /usr/local 中的权限,以便自制程序可以访问它们:

 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

原文由 Alexander Luna 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题