Python 2 to 3 conversion - embrace the pain

Michael Torrie torriem at gmail.com
Mon Mar 16 22:14:20 EDT 2015


On 03/16/2015 02:36 PM, Steven D'Aprano wrote:
> I'm sorry, that makes no sense to me. What does it matter whether Python3 is
> installed to /opt or /usr or /bin or /who/the/feck/cares, so long as your
> application runs when you run it? It's just another dependency, and no more
> than one call to yum away.

Of course it matters.  How else will you refer to it in the #!
invocation?  If Python3 is in the system path then you can use a wrapper
script like Calibre does.  But in the case of RHEL with Software
Collections (which does use yum), it does not place it in the system path.

> Yesterday I wrote:
> 
>     Alas, too many (Linux) developers insist on using the system Python
>     as their application language. In most cases they could trivially
>     run "aptitude install python3" and be done with it, but that's an 
>     extra dependency and therefore Bad.
> 
> I never imagined that anyone would argue that they can't install and use
> Python3 because of the location where it is installed. As an application
> developer, apart from ensuring that the PATH is setup correctly and maybe
> having to adjust a few hash-bang lines, how does the location of the Python
> binary affect you?

Well the thing is that it's *not* in the PATH by default.  So it does
affect me. The official way to use Python 3 in RHEL Software Collection
is to invoke with with this command line:

scl enable python33 bash

This gives you a shell where python3 is in the path.  You can put
Python3 in the path permanently by modifying /etc/profile.  There are
good reasons for SCL doing things this way, and it's not the only way.
Just pointing out that distro life isn't always rosy.






More information about the Python-list mailing list