试图在Mac上正常安装Python吗?

编程入门 行业动态 更新时间:2024-10-27 00:26:29
本文介绍了试图在Mac上正常安装Python吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我安装了装有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吗?

本文发布于:2023-07-05 15:57:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1039159.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Mac   Python

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!