Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6002

Specifying path to python executable

$
0
0

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:

  1. Install python-is-python3
apt-get install python-is-python3

Or,

  1. 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

Viewing all articles
Browse latest Browse all 6002

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>