Issues installing Python 2.7

Chris Angelico rosuav at gmail.com
Thu Nov 27 23:40:51 CET 2014


On Fri, Nov 28, 2014 at 4:40 AM, Dennis Lee Bieber
<wlfraed at ix.netcom.com> wrote:
> On Thu, 27 Nov 2014 11:53:10 +1100, Steven D'Aprano
> <steve+comp.lang.python at pearwood.info> declaimed the following:
>
>>billyfurlong at gmail.com wrote:
>
>>
>>> Add this to the bashrc
>>> export PATH=$PATH:/opt/python2.7/bin/
>>
>>I'm not so sure about that, but I don't have time to investigate right now.
>>
>         If this is for the user login (and where it won't conflict with the
> system startup processes) I'd have swapped the $PATH and /opt... order --
> putting the 2.7 bin directory ahead of the system bin directory.

I wouldn't. Do you know, for absolute certain, which programs you run
that end up calling on Python, perhaps via "#!/usr/bin/env python", or
perhaps by being shell scripts and running "python my_main_module.py",
or something? You'd break those. Unless, of course, you're making
absolutely sure there's no "python" command in the /opt/... directory,
in which case the PATH order won't have any semantic difference, and
directory caching will make sure there's virtually no performance
difference, so the current form is just as good.

That said, I have never compiled a Python 2, ever. I've always
compiled Py3, and let that happily take over the name "python3",
leaving the system Python 2.x on the name "python" and "python2".

ChrisA



More information about the Python-list mailing list