Reputation: 4962
Sorry, I'm sure this is a stupid question.
I have successfully installed python 2.6 with macports. How do I use that version of python? The version that shows when I type python in term is python 2.7.
Thanks!
Upvotes: 0
Views: 186
Reputation: 32671
Use the port select command to choose it
List the available pythons to select from:
port select --list python
to choose a specific port (eg python26):
port select python python26
However python2.6 will also choose the version specific one
Upvotes: 2
Reputation: 14633
One way to find Python on your Mac is to type in the command line:
which python
When I type this, I get:
/usr/bin/python
You can see other pythons there by typing
ls /usr/bin/python*
For example, I see:
/usr/bin/python
/usr/bin/python2.7
/usr/bin/python-config
/usr/bin/python2.7-config
/usr/bin/python2.5
/usr/bin/pythonw
/usr/bin/python2.5-config
/usr/bin/pythonw2.5
/usr/bin/python2.6
/usr/bin/pythonw2.6
/usr/bin/python2.6-config
/usr/bin/pythonw2.7
Then, you can run v2.6 by typing
/usr/bin/python2.6
Or, since /usr/bin/ is probably in your path, just:
python2.6
This isn't exactly MacPorts-specific, sorry.
Upvotes: -1
Reputation: 2840
You should be on Super User.
Call it from the terminal:
python26 PYTHONFILE.py
Upvotes: 0