How to install Python25 on my mac with Homebrew

时光毁灭记忆、已成空白 提交于 2019-12-05 20:52:05

python25 is available in the Homebrew-versions tap:

$ brew tap homebrew/versions
$ brew install python25

I think the brew tap homebrew/versions tip is no longer valid...

I have added that to my Homebrew, however it appears to point to this repo: https://github.com/Homebrew/homebrew-versions

...and that does not contain any Python versions.

$ brew search python25
No formula found for "python25".

So if you want to install a specific version other than latest 2.7.x or 3.x.x you need a different method, what worked for me is:

brew install pyenv
(complete the install instructions)
pyenv install 2.5

You can then switch Python versions either globally (default) or just in current shell session, see: https://github.com/yyuu/pyenv

Instead of using brew to install into the entire system a really old version of Python; consider using pythonbrew instead. It will isolate the python install - a bit like virtual environment, but for Python itself.

You're not doing anything wrong, I'm afraid you're just out of luck. Have a look on the list of formulae available: no Python2.5.

There could be a workaround: copy the python.rb gem and edit the lines mentioning a version number, switching from 2.7 to 2.5. Careful with line 31 (the sha1 signature), you'll want to edit that too.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!