Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
brew安装python-OSX失败_Python_Homebrew_Pythonbrew - Fatal编程技术网

brew安装python-OSX失败

brew安装python-OSX失败,python,homebrew,pythonbrew,Python,Homebrew,Pythonbrew,我正试图通过以下方式通过brew安装python: brew install python 但会出现以下错误: Stevens-MacBook-Pro :: ~ ‹master*› » brew install python ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/python-2.7. Already downloaded: /Library/Caches/Homebrew/pytho

我正试图通过以下方式通过
brew
安装python:

brew install python  
但会出现以下错误:

Stevens-MacBook-Pro :: ~ ‹master*› » brew install python
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/python-2.7.
Already downloaded: /Library/Caches/Homebrew/python-2.7.8_2.mountain_lion.bottle.tar.gz
==> Pouring python-2.7.8_2.mountain_lion.bottle.tar.gz
==> Caveats
Setuptools and Pip have been installed. To update them
  pip install --upgrade setuptools
  pip install --upgrade pip

You can install Python packages with
  pip install <package>

They will install into the site-package directory
  /usr/local/lib/python2.7/site-packages

See: https://github.com/Homebrew/homebrew/wiki/Homebrew-and-Python

.app bundles were installed.
Run `brew linkapps` to symlink these to /Applications.
/usr/bin/install_name_tool: object: /usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python malformed object (unknown load command 10)
Error: Failed to fix install names
The formula built, but you may encounter issues using it or linking other
formula against it.
==> /usr/local/Cellar/python/2.7.8_2/bin/python -ssetup.py --no-user-cfg instal
  using one of the approaches described here:

Please make the appropriate changes for your system and try again.
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall python`
==> Summary
Pyenv is a python version management tool, something like rbenv but for python.

You could easily install and change python version via pyenv easily.

The following shows how to install python with version 2.7.8 through pyenv:

ubuntu@ubuntu:~$ pyenv install 2.7.8
Downloading Python-2.7.8.tgz...
-> http://yyuu.github.io/pythons/74d70b914da4487aa1d97222b29e9554d042f825f26cb2b93abd20fdda56b557
Installing Python-2.7.8...
Installing setuptools from https://bootstrap.pypa.io/ez_setup.py...
Installing pip from https://bootstrap.pypa.io/get-pip.py...
Installed Python-2.7.8 to /home/ubuntu/.pyenv/versions/2.7.8
Stevens MacBook Pro::~èmaster*›»brew安装python
==>下载https://downloads.sf.net/project/machomebrew/Bottles/python-2.7.
已下载:/Library/Caches/Homebrew/python-2.7.8_2.mountain_lion.bottle.tar.gz
==>浇注python-2.7.8_2.mountain_lion.瓶子.tar.gz
==>注意事项
安装了Setuptools和Pip。更新它们
pip安装--升级安装工具
pip安装--升级pip
您可以使用安装Python包
pip安装
它们将安装到站点包目录中
/usr/local/lib/python2.7/site-packages
见:https://github.com/Homebrew/homebrew/wiki/Homebrew-and-Python
.已安装应用程序包。
运行“brew linkapps”将这些应用程序符号链接到/应用程序。
/usr/bin/install_name_tool:object:/usr/local/cillar/python/2.7.8_2/Frameworks/python.framework/Versions/2.7/Resources/python.app/Contents/MacOS/python畸形对象(未知加载命令10)
错误:无法修复安装名称
公式已生成,但使用它或链接其他公式时可能会遇到问题
反对它的公式。
==>/usr/local/ceral/python/2.7.8_2/bin/python-ssetup.py——没有用户cfg instal
使用此处描述的方法之一:
请对您的系统进行适当的更改,然后重试。
警告:安装后步骤未成功完成
您可以使用“brew postinstall python”重试`
==>摘要

Pyenv是一个python版本管理工具,类似于rbenv,但用于python

您可以通过pyenv轻松地安装和更改python版本

下面显示了如何通过pyenv安装版本为2.7.8的python:

正如你所看到的,这很简单

命令
pyenv install“version”
帮助您轻松安装特定版本的python,甚至pip、setuptools也会自动安装


我建议试试

你的安装工具似乎不好。
brew doctor
brew config
说什么?如果
brew doctor
向您发出有关install\u name\u工具的警告,您可能会考虑使用Pacifist之类的工具重新安装系统版本。是的,我没有足够的声誉留下评论,所以我只会发布一个答案。谢谢你的建议。当pyennv已经在使用自制软件时,使用它是没有意义的。我认为当你需要在不同版本(py2、py3、Pyy)之间工作时,pyenv仍然很有用。pyenv也在brew公式列表中。