开发者

system python versus user python

I've installed Python 2.7 using macports and because of my $PATH variable, that's the one I get when I type $ python. However, virtualenv defaults to using Python 2.6 unless I remember to force it to do otherwise with the -p flag.

On a related note, globally running yolk -l shows the following:

Python          - 2.6.1        - active development (/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload)

So my question is, should I do something to ensure the system is always using MacPorts' Python 2.7 or is it not worth worrying that 开发者_StackOverflowApple's Python 2.6.1 is apparently in the mix?


If you force python 2.7 globally on your system, things will break. You don't want to do that.

You should use virtualenvwrapper. It should choose your preferred python.

http://www.doughellmann.com/docs/virtualenvwrapper/install.html#python-interpreter-virtualenv-and-path


I have had similar problems, although not related specifically to virtualenv. I found that, after installing a particular version of python with macports, and having that version set as default, installing 3rd party modules that are build on or use python using macports solved all problems. You essentially end up with parallel builds, on top of different versions of python. I have a few, and switch between them using python_select. Also, see here on SO for how to get easy_install to work with your new python.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜