How to install Python25 on my mac with Homebrew

拜拜、爱过 提交于 2020-01-02 07:10:26

问题


I'm new to Mac's and Python. I want to install an older version of Python (2.5) on to the Mac (OS X 10.8.1). I'm using homebrew as it's newer than MacPorts and I don't know enough to choose between them.

Following instructions I have installed Rails, mySQL, budle, pow - all sorts of stuff, but when I use the same technique to install python 2.5 it doesn't work.

I tried:

Axolotl:.pow neil$ brew search python25
homebrew/versions/python25

Axolotl:.pow neil$ brew install python25
Error: No available formula for python25 
Axolotl:.pow neil$ brew install homebrew/versions/python25
Error: No available formula for python25 

Where am I going wrong? Thanks.


回答1:


python25 is available in the Homebrew-versions tap:

$ brew tap homebrew/versions
$ brew install python25



回答2:


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




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/12184308/how-to-install-python25-on-my-mac-with-homebrew

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