我安装了装有Xcode的Mac OSX 10.5.8.我想避免使用MacPorts,而只是想拥有一个坚实的Python安装基础,这样我就可以继续使用Django和其他东西了.我想在我的Python应用程序中使用Buildout.
I have Mac OSX 10.5.8 with Xcode installed. I want to avoid MacPorts and want to just get a solid Python install foundation so I can then move on to mess with Django and other things. I want to use Buildout with my Python applications.
我已经从官方站点安装了二进制Python 2.6.4并进行了安装.按照其他建议,我已将其放在我的~/.bash_profile文件中:
I have installed binary Python 2.6.4 from the official site and installed this. Following other advice I have put this in my ~/.bash_profile file:
export PATH=/usr/local/bin:$PATH所以,当我执行which python时,它会显示/usr/local/bin/python.而且,当我执行python -V时,它会显示Python 2.6.4-这一切似乎很棒.
So, when I do a which python it shows /usr/local/bin/python. And, when I do a python -V it shows Python 2.6.4 - this all seems great.
我已经查看了/usr/local/bin/文件夹,除其他外,我似乎拥有指向Python 2.6的正确内容:
I've looked inside the /usr/local/bin/ folder and, among other things, I seem to have the correct stuff pointing to Python 2.6:
python -> ../../../Library/Frameworks/Python.framework/Versions/2.6/bin/python但是,当我执行easy_install的virtualenv(我想与Buildout一起使用)时,似乎将其安装在/Library/Python/2.5/site-packages/virtualenv-1.4.3-py2.5.egg
BUT, when I do an easy_install of virtualenv (that I want to use with Buildout) it seems to install it in /Library/Python/2.5/site-packages/virtualenv-1.4.3-py2.5.egg
...哪个是Python 2.5?另外,当我使用virtualenv设置Buildout文件夹时,.Python符号链接将位于其中:
...which is Python 2.5? Also, when I setup my Buildout folder using virtualenv, in there the .Python symlink is going to:
.Python -> /System/Library/Frameworks/Python.framework/Versions/2.5/Python这是为什么?我不明白我如何才能全部指向正确的Python 2.6?
Why is this? I don't understand this. How can I get it all pointing to the correct Python 2.6?
非常感谢您提供任何答案,这真让我烦恼.干杯.
Thank you so much for any answers, it's annoying the hell out of me. Cheers.
推荐答案首先,绝对不需要安装新版本的Python在Leopard上的Django上运行.现有的Python 2.5绝对可以正常工作,而Django与该版本100%兼容.
Firstly, there's absolutely no need to install a new version of Python to work on Django in Leopard. The stock Python 2.5 works absolutely fine, and Django is 100% compatible with that version.
第二,如果您想将virtualenv与系统默认值以外的其他Python版本一起使用,则只需在创建virtualenv时告诉它:
Secondly, if you do want to use virtualenv with a different version of Python other than the system default, you simply need to tell it when you create the virtualenv:
virtualenv --python=/path/to/python/2.6 virtualenvname更多推荐
试图在Mac上正常安装Python吗?
发布评论