Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8835639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:18:17+00:00 2026-06-14T09:18:17+00:00

I am using setuptools (version 0.6c11) on Windows, and I specify console scripts to

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:18:18+00:00Added an answer on June 14, 2026 at 9:18 am

    Well, this works for me:

    # This file is setup.py
    import setuptools
    
    SOURCE = '''
    def main():
        print('Hello, world!')
    '''
    
    def prepare():
        with open('my_mod.py', 'w') as f:
            f.write(SOURCE)
    
    prepare()
    
    setuptools.setup(
        name = 'woo',
        version = '0.1',
        url = 'http://dummy.com/',
        author = 'Me',
        author_email = 'me@dummy.com',
        py_modules=['my_mod'],
        entry_points={
            'console_scripts':['myprog = my_mod:main']
       }
    )
    

    when I run it in a virtualenv:

    (venv) C:\temp\exemplar>python setup.py install
    running install
    running bdist_egg
    running egg_info
    writing woo.egg-info\PKG-INFO
    writing top-level names to woo.egg-info\top_level.txt
    writing dependency_links to woo.egg-info\dependency_links.txt
    writing entry points to woo.egg-info\entry_points.txt
    reading manifest file 'woo.egg-info\SOURCES.txt'
    writing manifest file 'woo.egg-info\SOURCES.txt'
    installing library code to build\bdist.win32\egg
    running install_lib
    running build_py
    creating build
    creating build\lib
    copying my_mod.py -> build\lib
    creating build\bdist.win32
    creating build\bdist.win32\egg
    copying build\lib\my_mod.py -> build\bdist.win32\egg
    byte-compiling build\bdist.win32\egg\my_mod.py to my_mod.pyc
    creating build\bdist.win32\egg\EGG-INFO
    copying woo.egg-info\PKG-INFO -> build\bdist.win32\egg\EGG-INFO
    copying woo.egg-info\SOURCES.txt -> build\bdist.win32\egg\EGG-INFO
    copying woo.egg-info\dependency_links.txt -> build\bdist.win32\egg\EGG-INFO
    copying woo.egg-info\entry_points.txt -> build\bdist.win32\egg\EGG-INFO
    copying woo.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO
    zip_safe flag not set; analyzing archive contents...
    creating 'dist\woo-0.1-py2.7.egg' and adding 'build\bdist.win32\egg' to it
    removing 'build\bdist.win32\egg' (and everything under it)
    Processing woo-0.1-py2.7.egg
    creating c:\temp\venv\lib\site-packages\woo-0.1-py2.7.egg
    Extracting woo-0.1-py2.7.egg to c:\temp\venv\lib\site-packages
    Adding woo 0.1 to easy-install.pth file
    Installing myprog-script.py script to C:\temp\venv\Scripts
    Installing myprog.exe script to C:\temp\venv\Scripts
    
    Installed c:\temp\venv\lib\site-packages\woo-0.1-py2.7.egg
    Processing dependencies for woo==0.1
    Finished processing dependencies for woo==0.1
    
    (venv) C:\temp\exemplar>pip uninstall woo
    Uninstalling woo:
      c:\temp\venv\lib\site-packages\woo-0.1-py2.7.egg
      c:\temp\venv\scripts\myprog-script.py
      c:\temp\venv\scripts\myprog.exe
    Proceed (y/n)? y
      Successfully uninstalled woo
    
    (venv) C:\temp\exemplar>
    

    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().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this code: code = 'import setuptools;__file__={0!r};execfile(__file__)'.format(os.path.join(path, 'setup.py')) args = ['install', '--single-version-externally-managed'] subprocess.check_call([sys.executable,
I was trying the python packaging using setuptools and to test I installed the
I am currently coding setup.py using setuptools. And I want to copy the static
A newbie question but..... I've installed python2.7 on a host where the system version
When I installed Python's setuptools I absent mindedly tacked on a --prefix path I
When you create a package using setuptools, you can do: setup( ... provides=[a list
If one installs a python package using setuptools, then executes a method in that
I was writing a setup.py for a Python package using setuptools and wanted to
I'm setting up a new machine and am using 64-bit Python 2.6.6 on Windows
I am using a Jython virtualenv where I can install whatever software via pip

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.