Let's say you have a large, distributed project with hundreds of scripts and some of those depend on Python. They date back 10 or 15 years. Those script start with
#!/usr/bin/env python
#!/usr/bin/python
Migrating to a world of Python3 (because everything really must switch to Python3) it seems there are two choices:
- Install python-is-python3
apt-get install python-is-python3
Or,
- Update the individual files over time. Set them to:
#!/usr/bin/python3
Both should work. The question is, which would be recommended? If the long term plan is for Python2 to be completely obsolete, and Python3 will be required, then perhaps in a couple years /usr/bin/python
will link to Python3 by default. Then it would be logical to continue using
#!/usr/bin/env python