如何使用Homebrew在OS X上安装Python 3.3(不是3.4)? [英] How to install Python 3.3 (not 3.4) on OS X with Homebrew?

查看:138
本文介绍了如何使用Homebrew在OS X上安装Python 3.3(不是3.4)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您通过Homebrew安装python3,则会默认安装最新版本。但是我想要3.3而不是3.4。如何用3.3版本替换本机?我想使用Python 3尝试Django,但我只是在学习Django,所以我想使用最新的稳定版本,目前为1.6,这与Python 3.3兼容。我想使用它与Python 3,所以它必须是3.3。 Django 1.7是Py3.4兼容的,但我不想混淆,直到它稳定...在OS X 10.8.5

解决方案

以下是您可以从自制软件常见问题解答中组合的一些元素。


  1. 我可以自己编辑公式吗? - 是的。

      brew编辑python3 


  2. 寻找 url 并将其更改为ftp链接到 3.3 3.3.6 )档案。


  3. 并使用 shasum 计算校验和。


  4. 将文件另存为 python33。 rb 并安装 brew install --debug python33.rb


传递 - debug 标志将帮助您防止某些步骤无法正常工作(例如,在最新的公式中,删除 2to3 二进制文件是一个问题),您可以尝试恢复 bootpap模块。

您可以在这里找到我使用的公式: https://gist.github .com / dnozay / 231a037d53e14052ccd6


If you install python3 through Homebrew it installs the latest version by default, which I did. But I want 3.3 instead of 3.4. How can I replace it with 3.3 specifically using Homebrew? I want to try Django with Python 3 but I'm just learning Django so I want to use the latest stable version, currently 1.6, which is compatible with up to Python 3.3. I want to use it with Python 3, so it has to be 3.3. Django 1.7 is Py3.4 compatible but I don't want to mess with that 'til it's stable... on OS X 10.8.5

解决方案

Here are some elements that you can piece together from the homebrew FAQ.

  1. Can I edit formulae myself? - yes.

    brew edit python3
    

  2. look for the url and change it to the ftp link to the 3.3 (3.3.6) archive.

  3. download the archive locally and compute the checksum with shasum.

  4. save the file as python33.rb and install with brew install --debug python33.rb.

Passing the --debug flag will help you in case some steps are not working properly (e.g. in the latest formula, removing the 2to3 binary was a problem), you may just try to revert this change as python3.3 does not have ensurepip bootstrap module.

You can find the formula I used here: https://gist.github.com/dnozay/231a037d53e14052ccd6

这篇关于如何使用Homebrew在OS X上安装Python 3.3(不是3.4)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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