问题
I'm working on Mac Os 10.7 (Lion) and I have some questions:
- What is the pre-installed version of python on Lion?
- I've been working on this computer for some time now, and i've installed lots of software in order to do college work many times I didn't know what I was really doing. The thing is: now I hava on the /Library/Frameworks/Python.framework/Versions/ a folder called "7.0" I'm pretty sure there no python version 7. Is this folder native or a third-part program installation. Can I delete it? (it's using 1 Gb on disk).
- Where is located the original python that comes with mac os?
- I've choose Homebrew as my package manager, is there a easy way to manage python versions with it?
回答1:
Lion uses Python 2.7 by default; 2.5 and 2.6 are also available.
/Library/Frameworks/Python.frameworkdoes not exist on a stock install of Lion. My guess is that you've ended up with this by installing some application.The default Python install is primarily installed in
/System/Library/Frameworks/Python.framework, although some components are located elsewhere.Yes - you can
brew install python@2to get a Python 2.7 separate from the system version, orbrew install pythonto get Python 3.7. Both will install to/usr/local, like any other Homebrew recipe.
回答2:
- I think that is Python 2.7 but you can check typing python on a command terminal. It will tell you the version.
- I couldn't tell that you can deleting it, because I don't know what it has... can you give more info about it?
- Just type "which python" and it will tell you
- You should use virtualenv and pip: http://jontourage.com/2011/02/09/virtualenv-pip-basics/
来源:https://stackoverflow.com/questions/10589590/python-versions-on-mac