FreeBSD Python version

Modulok modulok at gmail.com
Wed May 25 15:33:06 UTC 2011


On 5/24/11, Patrick Brookings <patrick at 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-


More information about the freebsd-questions mailing list