Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 May 2011 09:33:04 -0600
From:      Modulok <modulok@gmail.com>
To:        Patrick Brookings <patrick@icebluehost.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD Python version
Message-ID:  <BANLkTimUVqY%2B3hx9PvS3kN9e72WUPm43LQ@mail.gmail.com>
In-Reply-To: <FDAB8E888E724276AC9C53637D3FCA54@IceBlueHost>
References:  <FDAB8E888E724276AC9C53637D3FCA54@IceBlueHost>

next in thread | previous in thread | raw e-mail | index | archive | help
On 5/24/11, Patrick Brookings <patrick@icebluehost.com> wrote:
> Hello,
>
> Can you please tell me what standard version of Python comes with the latest
> FreeBSD?
> And also, is it possible to upgrade to a newer version without breaking
> other functionalities?
>
> I am asking because more and more scripts require at least Python 2.5,
> whereas CentOS for example only comes with 2.4.3, and it's pretty much
> impossible to upgrade the system Python without breaking yum and things like
> that.

You can install any version you want. Nothing in the FreeBSD base system
requires python. In fact, I have multiple versions installed on FreeBSD right
now. I'm running python 2.6, 2.7 and 3.2. In your hash bang line, just specify
the version that a specific script should run as. Something like:

#!/usr/bin/env python2.6
'''I'll use python 2.6'''


#!/usr/bin/env python2.7
'''I'll use python 2.7'''


#!/usr/bin/env python3.2
'''I'll use python 3.2'''


#!/usr/bin/env python
'''I'll use whatever version `which python` returns.'''


-Modulok-



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTimUVqY%2B3hx9PvS3kN9e72WUPm43LQ>