Brew - 安装python3.3

Ric*_*rdo 5 homebrew python-3.x

我想安装特定的3.3版本的python.

我试过了:

brew versions 不再受支持.

brew search python3 没有显示python3.X版本.

brew tap homebrew/versions 不起作用.

如何在macosx中安装python3.3 brew并且我不想使用pyenv.

Ric*_*rdo 1

根据这个答案

首先卸载python3

brew uninstall python3
Run Code Online (Sandbox Code Playgroud)

下载此公式 https://gist.github.com/booleangate/8f0bb23fdd53d699f763f0959c506049

然后转到下载公式的目录并引入终端

brew install --debug python33.rb
Run Code Online (Sandbox Code Playgroud)

从现在开始,如果你想运行这个版本的 python,你必须在终端上输入:

07:03:17 $ python3.3 
Python 3.3.6 (default, Jan 26 2016, 06:48:22) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.72)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 2+2                 
4
>>> 3*3==9
True
>>> 
Run Code Online (Sandbox Code Playgroud)

享受!

  • @TheMatt我建议安装pyenv。 (2认同)