Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

When I enter:

port select --list python

This is the result:

Available versions for python:
    none
    python25 (active)
    python25-apple
    python26-apple
    python27
    python27-apple

I thought when I use python I would be using version 2.5. Instead when I enter "python", version 2.7 seems to be active. How do I change that to version 2.5?

Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
915 views
Welcome To Ask or Share your Answers For Others

1 Answer

Use

osx$ port select --list python

to list your available Python installations.

Then use the "--set" option to "port select" to set the port you wish to use.

osx$ sudo port select --set python python27

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...