I am using setuptools (version 0.6c11) on Windows, and I specify console scripts to be installed via console_scripts entry point. It works fine on Linux, but under Windows, using the MinGW compiler, there are no scripts installed. I don’t see any realted message in the install output.
Other packages, like ipython, are doing just fine and have working .exe files after running setup.py install.
Can someone suggest a way to debug that?
import setuptools
setup(
# ...
entry_points={
'console_scripts':[
'myprog = myMod:main'
]
}
)
UPDATE:
Based on the examples posed by Vinay (thanks!), I was able to isolate the problem: if a module is installed in nested subdirectory, script is not created:
import setuptools, os.path, shutil
SOURCE = '''
def main():
print('Hello, world!')
'''
### ERROR: when level of subdir is > 1, script is not created
subdir='subdir/subdir2'
### OK: with single-level subdirectory, everything works just fine
# subdir='subdir'
def prepare():
# remove previous source
if os.path.exists('subdir'): shutil.rmtree('subdir')
# create subdirs as necessary
os.makedirs(subdir)
with open(subdir+'/my_mod.py', 'w') as f: f.write(SOURCE)
prepare()
setuptools.setup(
name = 'myprog',
version = '0.1',
url = 'http://dummy.com/',
author = 'Me',
author_email = 'me@dummy.com',
py_modules=['my_mod'],
package_dir={'':subdir},
entry_points={
'console_scripts':['myprog = my_mod:main']
},
zip_safe=False
)
Am I misunderstanding what is package_dir for?
Well, this works for me:
when I run it in a virtualenv:
Update:
Your problem is not using the correct path separator: using
subdir=’subdir\\subdir2′
worked for me. Of course, you should probably use
os.path.join().