Discussion:
FreeBSD Python version
Patrick Brookings
2011-05-25 04:58:56 UTC
Permalink
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.

Many thanks.

Best regards,

Patrick Brookings
Robert Huff
2011-05-25 11:53:39 UTC
Permalink
Post by Patrick Brookings
Can you please tell me what standard version of Python comes with the latest FreeBSD?
Try "grep ^pyth /usr/ports/INDEX" on an up-to-date ports tree.
Post by Patrick Brookings
And also, is it possible to upgrade to a
newer version without breaking other functionalities?
Maybe, maybe not; it would vary by the port that uses python.
See /usr/ports/UPDATING for possible issues.


Robert Huff
Jerry
2011-05-25 11:54:15 UTC
Permalink
On Wed, 25 May 2011 07:58:56 +0300
Post by Patrick Brookings
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.
I think it it 2.7.1:

python --version
Python 2.7.1

That is what I have anyway, and I don't remember ever updating it.
There is Python 3.2.0 available in the ports system. The new release
version from python for 3.2.1RC1 is due out May 23. It will probably
reach the ports shortly after that date.
--
Jerry ✌
jerry+***@seibercom.net

Disclaimer: off-list followups get on-list replies or ignored.
Do not CC this poster. Please do not ignore the "Reply-To" header.

http://www.catb.org/~esr/faqs/smart-questions.html
Matthew Seaman
2011-05-25 11:55:28 UTC
Permalink
Post by Patrick Brookings
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?
python doesn't come as standard with FreeBSD. It's an add-on you'ld
install from the ports. The base system doesn't need python -- just
about everything is written in some combination of shell or C/C++ or make.

Upgrade to a newer version of python or a newer version of FreeBSD? I
believe the answer is yes in both cases, but really it depends on the
delta in version numbers and whether your particular application
requires any specific features affected by the upgrade.
Post by Patrick Brookings
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.
The following versions are available in ports:

lucid-nonsense:/usr/ports/lang:% ls -lad python??
drwxr-xr-x 3 root wheel 8 Jul 20 2010 python24/
drwxr-xr-x 3 root wheel 8 Mar 5 07:56 python25/
drwxr-xr-x 3 root wheel 7 Mar 8 06:12 python26/
drwxr-xr-x 3 root wheel 7 Mar 26 09:45 python27/
drwxr-xr-x 3 root wheel 8 Mar 5 07:56 python31/
drwxr-xr-x 3 root wheel 8 Mar 5 07:56 python32/

or there's the lang/python port which is a meta-port that gets you the
default version, currently python-2.7

Cheers,

Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: ***@infracaninophile.co.uk Kent, CT11 9PW
Daniel Bye
2011-05-25 11:45:04 UTC
Permalink
Post by Patrick Brookings
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?
FreeBSD doesn't have Python installed as part of the standard system - it is
available as a third party port. The default port version was recently
upgraded to 2.7, and the entry for 20110304 in /usr/ports/UPDATING has clear
instructions on how to upgrade already installed Python packages.
Post by Patrick Brookings
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.
There is nothing in the base system that relies on Python, so following the
upgrade procedure will not break any essential standard tools. If all your
currently installed Python packages were installed by means of the ports
system, the update should correctly update them all for you. Anything
installed by any other means, though, will need to be dealt with manually.

Dan
--
Daniel Bye
_
ASCII ribbon campaign ( )
- against HTML, vCards and X
- proprietary attachments in e-mail / \
Modulok
2011-05-25 15:33:04 UTC
Permalink
Post by Patrick Brookings
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-

Loading...