I would like to install a script with setuptools and do the following setup:
There are files in my development directory
The z_script.py file is as follows:
def main(): print "Running..."
and my setup.py looks like this:
from setuptools import setup setup( name = 'z_script', version = '0.2', entry_points = {"console_scripts": ["z_script = z_script:main"]}, )
When I run python setup.py install , the script successfully installs into the correct bin directory.
However, when I run the script with z_script , an error occurs:
Traceback (most recent call last): File "./z_script", line 8, in <module> load_entry_point('z-script==0.2', 'console_scripts', 'z_script')() File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 318, in load_entry_point File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 2221, in load_entry_point File "/home/woltan/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1954, in load ImportError: No module named z_script
The bin is accessible through the PATH environment variable from the idea that the system and the PYTHONPATH environment variable PYTHONPATH set when z_scirpt .
And now to my question:
What is wrong with my setup? Why could not the script find the correct module?