<br><br><div class="gmail_quote">On 13 December 2011 11:40, Andrea Crotti <span dir="ltr">&lt;<a href="mailto:andrea.crotti.0@gmail.com">andrea.crotti.0@gmail.com</a>&gt;</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 &quot;python setup.py develop&quot; 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: &#39;psi.devsonly==0.1&#39;,&#39;dev_main.<u></u>py&#39;<br>
__requires__ = &#39;psi.devsonly==0.1&#39;<br>
from pkg_resources import require; require(&#39;psi.devsonly==0.1&#39;)<br>
del require<br>
__file__ = &#39;h:\\long\\path\\bin\\dev_<u></u>main.py&#39;<br>
execfile(__file__)<br>
<br>
c:\python25\script is actually in the $PATH, but if I try to launch<br>
that command it doesn&#39;t work because it tries with c:\Python27.<br>
<br>
long\path\git_projs\Psi&gt;dev_<u></u>main.py -h<br>
dev_main.py -h<br>
Traceback (most recent call last):<br>
  File &quot;C:\python25\scripts\dev_main.<u></u>py&quot;, line 4, in &lt;module&gt;<br>
    from pkg_resources import require; require(&#39;psi.devsonly==0.1&#39;)<br>
  File &quot;C:\Python27\lib\site-<u></u>packages\setuptools-0.6c11-<u></u>py2.7.egg\pkg_resources.py&quot;, line 2603, in &lt;module&gt;<br>
  File &quot;C:\Python27\lib\site-<u></u>packages\setuptools-0.6c11-<u></u>py2.7.egg\pkg_resources.py&quot;, line 666, in require<br>
  File &quot;C:\Python27\lib\site-<u></u>packages\setuptools-0.6c11-<u></u>py2.7.egg\pkg_resources.py&quot;, 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&#39;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 &quot;setup.py develop&quot; 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>