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!
import py2exeline in one of my setup scripts.help("modules py2exe"), witch searches for modules with similar names like "py2exe", finds py2exe in the shell but returns None if executed in a file! Python.exe is the same, I've checked that withsys.executable. It's not the first time I installed an external library, all others worked.site.pyis screwy? Where did you get your python install from?py2exeor the like? Perhaps you're creating confusion for the interpreter because of something it's finding in your path that it shouldn't and preventing the actual py2exe module from being loaded?