OSX通过brew为python3安装numpy

spe*_*eer 4 python homebrew numpy python-3.x

我不能通过brew为python3安装numpy.

我键入:

brew install numpy --with-python3
Run Code Online (Sandbox Code Playgroud)

然后它对python2没问题

Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>
Run Code Online (Sandbox Code Playgroud)

但仍未找到python3

Python 3.4.0 (v3.4.0:04f714765c13, Mar 15 2014, 23:02:41) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'
>>>
Run Code Online (Sandbox Code Playgroud)

如何让它适用于python3?

sor*_*rin 6

安装它的正确方法是:

pip3 install numpy
Run Code Online (Sandbox Code Playgroud)

显然,你需要先安装python3和pip.我测试和工作没有任何问题.

  • 谢谢,我知道 pip3 工作得很好。也许我不准确,我需要从 brew 安装。这是关于特定版本和其他依赖项。 (2认同)