Error: bin file does not exist, ex46

In relation to Ex 46 - cannot get setup.py to work

When I try and install my project I get the error:
error: file ‘…\projects\text adventure\bin\helloworld’ does not exist

my directory looks like this:

  • bin
    – helloworld.py
  • docs
  • game
    init.py
    – engine.py
    – main.py
    – rooms.py
  • tests
    init.py
    – game_tests.py
  • setup.py

my setup.py looks like this:

try:

    from setuptools import setup

except ImportError:

    from distutils.core import setup

config = {

    'description': 'A simple text adventure',

    'author': 'Niels Schneider',

    'url': 'URL to get it at.',

    'download_url': 'Where to download it.',

    'author_email': 'niels.r.schneider@gmail.com',

    'version': '0.1',

    'install_requires':['nose'],

    'packages': ['game'],

    'scripts': ['bin\helloworld'],

    'name': 'game'

}

setup(**config)

similarly when I try to use the distutils with “python setup.py sdist” it successfully creates a zip file, but the bin directory is not included.

Ok, looks good except try changing the following things:

  1. bin/ instead of bin\
  2. bin/helloworld.py instead of bin/helloworld
  3. OR, instead of #2, rename the file bin/helloworld to match what’s in your setup.py

Try those then report back.

So I’ve tried 1 and 2.
Adding .py in the setup.py did the trick. Once that’s in place either version of the slash works.

1 Like