Setting Python Default Version

Hello,

FreeBSD vers 7.2 ; i386 platform

I have several versions of python installed

Code:
#1736:> ls /usr/local/bin/python*
/usr/local/bin/python*                  /usr/local/bin/python-config*           
/usr/local/bin/python-shared-config*    /usr/local/bin/python-shared2.6*        
/usr/local/bin/python-shared2.7*        /usr/local/bin/python-shared2.7-config* 
/usr/local/bin/python2.6-config*        /usr/local/bin/python2.7*               
/usr/local/bin/python-shared*			/usr/local/bin/python-shared2.6-config*
/usr/local/bin/python2.6*			/usr/local/bin/python2.7-config*

And want to make python2.6 as the default version to run

Code:
#1737:> cat /etc/make.conf
#
# X.Org X-Windows in use
X_WINDOW_SYSTEM=xorg

# added python26 as default 2010-12-02
PYTHON_DEFAULT_VERSION=python2.6

ENABLE_SUIDPERL=true

# added by use.perl 2011-01-11 10:58:01
PERL_VERSION=5.8.9


But when I start the python interpreter, I seem to be getting python 2.7 instead

Code:
#1738:> python
Python 2.7.1 (r271:86832, Dec  2 2010, 09:40:18)
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>>
#1739:>

Any suggestions?

Thanks!
 
make.conf does not set the default version to run, just the version to use as a dependency.

/usr/local/bin/python is a hard link. It may be as simple as whichever python package was installed last overwrites it.
 
OK! I have a program that insists on python 2.6 how do I effect it if I have 2.7 running as the default?
 
BTW: the package has ~70 *.py files, do I have to rewrites all these files? There seems to be an options in the Makefile of the program =>
Code:
USE_PYTHON=     2.4+

Guess I can change it to

Code:
USE_PYTHON=     2.7+

and reinstall?

Thanks!
 
I was talking about changing the shebang line.

2.4+ should include 2.4 and anything above. If you would give the name of the mysterious package that requires this, it may be possible to be more specific.
 
How does it require python2.6? Looks like all that was needed was to rebuild it (mail/tmda), although maybe having multiple versions of python installed interfered.
 
Back
Top