<br><br><div class="gmail_quote">On 13 December 2011 11:40, Andrea Crotti <span dir="ltr"><<a href="mailto:andrea.crotti.0@gmail.com">andrea.crotti.0@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have a script installed with "python setup.py develop" on windows 7 in<br>
the directory c:\python25\scripts.<br>
<br>
The script looks like:<br>
<br>
#!c:\python25\python.exe<br>
# EASY-INSTALL-DEV-SCRIPT: 'psi.devsonly==0.1','dev_main.<u></u>py'<br>
__requires__ = 'psi.devsonly==0.1'<br>
from pkg_resources import require; require('psi.devsonly==0.1')<br>
del require<br>
__file__ = 'h:\\long\\path\\bin\\dev_<u></u>main.py'<br>
execfile(__file__)<br>
<br>
c:\python25\script is actually in the $PATH, but if I try to launch<br>
that command it doesn't work because it tries with c:\Python27.<br>
<br>
long\path\git_projs\Psi>dev_<u></u>main.py -h<br>
dev_main.py -h<br>
Traceback (most recent call last):<br>
File "C:\python25\scripts\dev_main.<u></u>py", line 4, in <module><br>
from pkg_resources import require; require('psi.devsonly==0.1')<br>
File "C:\Python27\lib\site-<u></u>packages\setuptools-0.6c11-<u></u>py2.7.egg\pkg_resources.py", line 2603, in <module><br>
File "C:\Python27\lib\site-<u></u>packages\setuptools-0.6c11-<u></u>py2.7.egg\pkg_resources.py", line 666, in require<br>
File "C:\Python27\lib\site-<u></u>packages\setuptools-0.6c11-<u></u>py2.7.egg\pkg_resources.py", line 565, in resolve<br>
pkg_resources.<u></u>DistributionNotFound: psi.devsonly==0.1<br>
<br>
<br>
This makes me thing that<br>
- the shebang is absolutely ignored<br></blockquote><div><br></div><div><br></div><div>Yes, Windows ignores shebang lines, they're a UNIX convention. Windows uses file associations to decide what program to launch scripts with.</div>
<div><br></div><div>The Windows Python installer associates .py files with python.exe - so the most recent version of Python you installed will have the file association.</div><div><br></div><div>For scripts on Windows I *thought* setuptools created .exe wrappers to get round this problem. It may not do this when you use "setup.py develop" though.</div>
<div><br></div><div>All the best,</div><div> </div><div><br></div><div>Michael Foord</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- some other weird bug<br>
<br>
Is there a way to solve this thing?<br>
______________________________<u></u>_________________<br>
Distutils-SIG maillist - <a href="mailto:Distutils-SIG@python.org" target="_blank">Distutils-SIG@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/distutils-sig" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/distutils-sig</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><pre cols="72"><a href="http://www.voidspace.org.uk/" target="_blank">http://www.voidspace.org.uk/</a><br><br>May you do good and not evil<br>May you find forgiveness for yourself and forgive others<br>
May you share freely, never taking more than you give.<br>-- the sqlite blessing <a href="http://www.sqlite.org/different.html" target="_blank">http://www.sqlite.org/different.html</a></pre>
<br>