在Mac 10.8上使用自制Python在scipy安装的正确位置是什么? [英] What is the proper location for scipy installation on Mac 10.8 with homebrew Python?

查看:158
本文介绍了在Mac 10.8上使用自制Python在scipy安装的正确位置是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了大多数pythonista的建议,并设置了与Mac OS X内置的版本不同的Python版本.四处浏览之后,似乎最好的处理方法是使用homebrew,然后跟进pip.通过numpy一切都很好,然后情况就变糟了.我无法安装scipymatplotlib.在这里在StackOverflow上搜索并尝试了多种解决方案后,我终于偶然发现了Chris Fonnesbeck的"Scipy Superpack" ,它承诺:

I followed the advice of most pythonistas and set up a different version of Python with which to play than the one that comes built into Mac OS X. After scanning around, it seemed like the best way to handle things was to use homebrew, and then to follow up with pip. All was good up through numpy, and then things went bad. I can't get scipy to install nor matplotlib. After searching here at StackOverflow and trying a number of solutions, I finally stumbled across Chris Fonnesbeck's "Scipy Superpack", which promises to:

安装最新的64位版本的Numpy(1.8)和Scipy(0.12),Matplotlib(1.3),iPython(0.14),Pandas(0.10),Statsmodels(0.5.0),Scikit-Learn 0.13以及在Macintosh电脑上,适用于OS X 10.8(Mountain Lion)的PyMC(2.2).

install recent 64-bit builds of Numpy (1.8) and Scipy (0.12), Matplotlib (1.3), iPython (0.14), Pandas (0.10), Statsmodels (0.5.0), Scikit-Learn 0.13, as well as PyMC (2.2) for OS X 10.8 (Mountain Lion) on Intel Macintosh.

这听起来很不错,但是当我看安装脚本install_superpack.sh时,似乎正在指导事情与系统版本的python一起使用:

That all sounds great to my noobie ears, but when I look at the install script, install_superpack.sh, it seems to be directing things to work with the system's version of python:

#!/bin/sh
PYTHON='/usr/bin/python'
GIT_FILENAME='git-1.7.7.3-intel-universal-snow-leopard'
GIT_VOLUME='/Volumes/Git 1.7.7.3 Snow Leopard Intel Universal/'
GFORTRAN='gcc-42-5666.3-darwin11.pkg'
SUDO='sudo'

我应该更改上面的PYTHON变量还是保留该变量,并对PYTHON环境进行调整(是?!我还应该编辑什么(如果有的话)?还是因为我显然超出了我的深度,我应该放弃该脚本吗?

Should I change the PYTHON variable above or leave it be and make adjustments to the PYTHON ENVIRONMENT (yes?! No!?) thingamabob I have read about elsewhere? What else, if anything, should I edit? Or should I just back away from this script since I clearly am out of my depth?

我应该注意,我非常想在计算机上运行matplotlib,因为我想玩直方图来进行某些文本分析.

I should note that I would dearly love to get matplotlib running on my machine because I'd like to play with making histograms for some text analysis I am pursuing.

推荐答案

superpack是为Apple python编译的.它可能与您从自制的python一起工作,但不建议这样做.

The superpack was compiled for the Apple python. It might work with your python from homebrew, but it's not recommended.

顺便说一句,当你说:

处理事情的最好方法似乎是使用自制软件,然后跟进pip

it seemed like the best way to handle things was to use homebrew, and then to follow up with pip

如果这是真的,那么这里就不会有很多人会用自制软件/点子安装scipy遇到麻烦的问题. Homebrew和pip非常适合简约的纯python软件包.但是,使用需要外部非Python程序包的scipy或程序包时,它们会令人惊奇地跌倒.

If this was true, then there wouldn't be a ton of questions here of people having trouble installing scipy with homebrew/pip. Homebrew and pip are great for minimalistic, pure python packages. But they stumble spectacularly with scipy or packages that require external non-python packages.

由于Macports现在具有适用于OSX 10.8的buildbot,我个人认为没有理由为什么有人会为自制的Python安装而烦恼自制软件/pip.有了良好的互联网连接,安装完整的设置将需要几分钟的时间,并且您可以让matplotlib拥有任意数量的后端.

With Macports now having a buildbot for OSX 10.8, I personally see no reason why anyone would want to bother with homebrew/pip for a scientific python install. With a good internet connection it will take minutes to install a full setup, and you can have matplotlib with as many backends as you want.

这篇关于在Mac 10.8上使用自制Python在scipy安装的正确位置是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆