# Ex 46 - cannot get setup.py to work

Here is my setup.py:

try:
from setuptools import setup
except ImportError:
from distutils.core import setup

config = {
'description': 'This is Dumb Project.',
'author': 'James C. Maxwell',
'url': 'http://www.github.com',
'author_email': 'freespaceimpedance@gmail.com',
'version': '0.1',
'install_requires': ['nose'],
'packages': ['dumb'],
'scripts': ['frobnicate'],
'name': 'DumbProject'
}

setup(**config)

All the required things are in the right places, for instance, there is a module (dumb.py) in an appropriately-named folder (/DumbProject/dumb) as well as a script in /DumbProject/bin (frobnicate.py).

Yet, if I run “python setup.py install” it does not complete successfully. Here’s what the session looks like:

PS C:\Users\WinTenProBox\Google Drive\Python\test_directory\projects\DumbProject> python setup.py install                     running install
running bdist_egg
running egg_info
writing requirements to DumbProject.egg-info\requires.txt
writing DumbProject.egg-info\PKG-INFO
writing top-level names to DumbProject.egg-info\top_level.txt
writing manifest file 'DumbProject.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
installing scripts to build\bdist.win-amd64\egg\EGG-INFO\scripts
running install_scripts
running build_scripts
error: file 'C:\Users\WinTenProBox\Google Drive\Python\test_directory\projects\DumbProject\bin\frobnicate' does not exist

I tried explicitly adding ./bin to the system path within the setup script. Same result. Why does Python refuse to see frobnicate.py and complain that it “does not exist” when it definitely does?

Triple check that

bin\frobnicate


Is actually in the bin directory. And I mean exactly that. If you named it bin/frobnicate.py then that’s not going to work.

I have the same problem.
Triple checked the file exists in the bin directory and is spelled the same way as in the setup.py file.
I noticed however that there is no bin directory in the zip that the sdist creates.
Could it have to do with that?

It’s probably because the ./bin directory isn’t listed in the setup.py. I’m working from memory here but I believe it goes in ‘scripts’. Can you paste your setup.py so I can see? Also, can you start a new post @drshnizzle so I can answer your specific problem better?

When you paste your code put it like this:

[code]