[Distutils] pkg_resources on Windows

Andrea Crotti andrea.crotti.0 at gmail.com
Tue Dec 13 12:40:35 CET 2011


I have a script installed with "python setup.py develop" on windows 7 in
the directory c:\python25\scripts.

The script looks like:

#!c:\python25\python.exe
# EASY-INSTALL-DEV-SCRIPT: 'psi.devsonly==0.1','dev_main.py'
__requires__ = 'psi.devsonly==0.1'
from pkg_resources import require; require('psi.devsonly==0.1')
del require
__file__ = 'h:\\long\\path\\bin\\dev_main.py'
execfile(__file__)

c:\python25\script is actually in the $PATH, but if I try to launch
that command it doesn't work because it tries with c:\Python27.

long\path\git_projs\Psi>dev_main.py -h
dev_main.py -h
Traceback (most recent call last):
   File "C:\python25\scripts\dev_main.py", line 4, in <module>
     from pkg_resources import require; require('psi.devsonly==0.1')
   File 
"C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", 
line 2603, in <module>
   File 
"C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", 
line 666, in require
   File 
"C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", 
line 565, in resolve
pkg_resources.DistributionNotFound: psi.devsonly==0.1


This makes me thing that
- the shebang is absolutely ignored
- some other weird bug

Is there a way to solve this thing?


More information about the Distutils-SIG mailing list