I have a Python package that includes a few scripts in a scripts/ folder. My setup.py file includes::
#!/usr/bin/env python
from distutils.core import setup
scripts = ['script1', 'script2', 'script3']
setup(name='Test',
version='0.1.0',
packages=['test'],
scripts=['scripts/' + x for x in scripts]
)
Each script contains the line::
#!/usr/bin/env python
at the top. However, when I run python setup.py install this line gets changed to::
#!/usr/bin/python
automatically in the installed scripts. Is there a way to avoid this? The reason that this is a problem for me is because I am using virtualenv, and so the correct path for the Python executable should be::
#/Users/user/.virtualenvs/default/bin/python
so I'd rather it left the interpreter set to::
#!/usr/bin/env python
Thanks for any advice!
builddirectory and tried again, it changed the path to the correct one, but I'd still be interested to know whether it's possible to keep the original#!/usr/bin/env python.