[Distutils] Unable to import python script after installing using easy_install

ray terrill rayjohnterrill at gmail.com
Fri Jan 9 22:03:08 CET 2009

I'm using python2.4 to try to package and deliver a custom python script.
I'm unable to import the package.

My setup.py looks like the following:
from setuptools import setup, find_packages
   name = "randomscript",
   version = "1.0",
   packages = find_packages(),

I'm building the package using the following:
python setup.py bdist_egg
running bdist_egg
running egg_info
writing randomscript.egg-info/PKG-INFO
writing top-level names to randomscript.egg-info/top_level.txt
writing dependency_links to randomscript.egg-info/dependency_links.txt
reading manifest file 'randomscript.egg-info/SOURCES.txt'
writing manifest file 'randomscript.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-i686/egg
running install_lib
warning: install_lib: 'build/lib' does not exist -- no Python modules to
creating build/bdist.linux-i686/egg
creating build/bdist.linux-i686/egg/EGG-INFO
copying randomscript.egg-info/PKG-INFO ->
copying randomscript.egg-info/SOURCES.txt ->
copying randomscript.egg-info/dependency_links.txt ->
copying randomscript.egg-info/top_level.txt ->
zip_safe flag not set; analyzing archive contents...
creating 'dist/randomscript-1.0-py2.4.egg' and adding
'build/bdist.linux-i686/egg' to it
removing 'build/bdist.linux-i686/egg' (and everything under it)

I'm installing the package using the following:
easy_install randomscript-1.0-py2.4.egg
Processing randomscript-1.0-py2.4.egg
Copying randomscript-1.0-py2.4.egg to /usr/lib/python2.4/site-packages
Adding randomscript 1.0 to easy-install.pth file

Installed /usr/lib/python2.4/site-packages/randomscript-1.0-py2.4.egg
Processing dependencies for randomscript==1.0
Finished processing dependencies for randomscript==1.0

If I attempt to use the script, I get an import error, but I do see the
script listed in my sys.path:
ImportError: No module named randomscript

'/usr/lib/python24.zip', '/usr/lib/python2.4',
'/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk',
'/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages']

Also, if I cd to /usr/lib/python2.4/site-packages/, I see that my egg is
there, but is not a directory (should it be)?
-rw-r--r--   1 root root  819 2009-01-09 20:06 randomscript-1.0-py2.4.egg

Any help would be appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20090109/8ab37721/attachment.htm>

More information about the Distutils-SIG mailing list