I can't figure out how to use py2exe, what am I doing wrong?
This is my my setup.py file witch is in the same folder as the rest of my project:
from distutils.core import setup
import py2exe
setup(console=['main.py'])
And then, as described on the homepage of py2exe, I navigate to the project directory with my python-files and type
python setup.py py2exe
But I only get this error!
E:\Programme(x86)\Python2.7x86\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'console'
warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'py2exe'
I've seen and read this post and lot's of others, but all seem to solve the problem by:
- installing py2exe
- navigating to the source path
- typing in the correct command
- correcting setup.py
All this (seems to me) is correct in my case. Maybe the solution is written in the error, but I can't interpret it usefully...
Other things I tried:
- Use absolute paths
- python setup.py py2exe install
I recognized that the problem occurs while importing py2exe, python doesn't execute anything after the second line.
Note: The PATH variable is correctly set, typing "python" and then "import py2exe" into the cmd works fine.
Thanks!