[Distutils] setuptools: Problem with auto-scripts and standalone scripts

Frank McIngvale fmcingvale at gmail.com
Thu Jul 5 16:26:12 CEST 2007


Hi, I'm trying to use setuptools auto-script feature with standalone scripts
and am having problems.

Say I have a script "mypkg/scripts/foo.py":
---------------------
import sys
print "Hello foo! My args are:",sys.argv
---------------------

When I try wrapping it like this:

            'console_scripts': [
                'foo = mypkg.scripts.foo',
            ]

Then run like this:
$ foo aa bb cc

It appears to start OK (and it gets the cmdline args) but crashes with a
traceback:
------------
Hello foo! My args are: ['c:\\frank\\py25\\Scripts\\foo-script.py', 'aa',
'bb', 'cc']
Traceback (most recent call last):
  File "c:\frank\py25\Scripts\foo-script.py", line 8, in <module>
    load_entry_point('mypkg==0.99.50-rc1', 'console_scripts', 'foo')()
TypeError: 'module' object is not callable
------------

Am I setting up 'console_scripts' incorrectly, or is this kind of usage not
supported?

thanks,
Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/distutils-sig/attachments/20070705/ac7dcc14/attachment.html 


More information about the Distutils-SIG mailing list