[arch-general] An archlinux-python package for managing system default python version?

Eli Schwartz eschwartz93 at gmail.com
Fri Jan 23 19:32:37 UTC 2015


On Fri, Jan 23, 2015 at 12:42 PM, Chi Hsuan Yen <yan12125 at gmail.com> wrote:
>
> I mean, all python scripts should explicitly specify which python version
> to use rather than "python" only. However, the system default symlink is
> still necessary for invoking scripts. A system should provide a simple and
> stupid way for python users without enforcing the knownledge of different
> python versions. As python evolves, end users can still invoke python
> scripts without change their command lines. After all, such settings can
> provide a continuous and reliable environment. I need this workaround due
> to the convenience for building CyanogenMod. The correct way may be submit
> a bug report to Google, but, however, it's too long to get them all be
> fixed.


Well, in the meantime you can do what the PKGBUILDs do, and use

sed -i 's:\(env[ ]\+python$\|/usr/bin/python$\):\12:g'

to fix the shebangs automatically for each file needed.
You can simply apply that to all *.py files, or if some of them
specifically need python3 you can make a list of them and exclude
them/add python3 to them.

Obviously, the long-term goal should be to get that done as an upstream bugfix.

-- Eli Schwartz


More information about the arch-general mailing list