Setuptools - help!

Peter Chant REMpeteOVE at
Fri Aug 7 01:04:46 CEST 2009


any ideas, I'm floundering - I don't quite get it.  I have the following
files, and in a directory pphoto:

# more
from setuptools import setup, find_packages
    name = "Pphoto",
    version = "0.1",
    packages = find_packages(),

    # other arguments here...
    entry_points = {'console_scripts': ['foo = pphoto.main:HelloWorld',]}


bash-3.1# more

def HelloWorld():
    print "Hello World!"

print "Odd world"

>From various websites that should produce a script foo that runs HelloWorld. 
It does produce a script that simply crashes.

bash-3.1# foo
Traceback (most recent call last):
  File "/usr/bin/foo", line 8, in <module>
    load_entry_point('Pphoto==0.1', 'console_scripts', 'foo')()
  File "build/bdist.linux-i686/egg/", line 277, in
  File "build/bdist.linux-i686/egg/", line 2098, in
  File "build/bdist.linux-i686/egg/", line 1831, in load
ImportError: No module named pphoto.main

Note, doing this as root as it seems not to do anything usefull at all if I
run python setup develop as a user. 

Any ideas?  I must be missing something fundamental?



More information about the Python-list mailing list