Jump to content

Py2exe won't work in Command Prompt.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
toxifyshadow

toxifyshadow

    Programmer

  • Members
  • PipPipPipPip
  • 125 posts
I have a working python program, and a setup.py written.
When I try to run this script

python filename.py py2exe

in Command Prompt, it says "'python' is not recognized as an internal or external command, (rest of error here) "
How do I fix this?
Posted Image

#2
manux

manux

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 234 posts
You have to add "C:/Python26/", or wherever you installed Python, to your PATH variable.
The PATH variable is a Windows variable which contains all the paths where the command prompt looks for executables, such as python.
It's in the form:

Quote

C:/Path/Number/one;C:/Another/Path;C:/Program Files/Java/bin;C:/Python26/;
(notice the semi-colons)

I don't know what version of windows you have, here's for XP:
How to set the path in Windows 2000 / Windows XP.

If you're not on XP, google "set windows VERSION path", where version is "seven", "vista", "server", etc...

#3
toxifyshadow

toxifyshadow

    Programmer

  • Members
  • PipPipPipPip
  • 125 posts
Yes, I have Xp with SP#2.
Posted Image

#4
toxifyshadow

toxifyshadow

    Programmer

  • Members
  • PipPipPipPip
  • 125 posts
Now it's telling me "No such file or directory" But, thanks for the help, now atleast it runs Python!
Posted Image

#5
toxifyshadow

toxifyshadow

    Programmer

  • Members
  • PipPipPipPip
  • 125 posts
Do I need to specify the exact file path for setup.py, from C:\ to setup.py?
Posted Image

#6
Elementell

Elementell

    Newbie

  • Members
  • Pip
  • 3 posts
Yes, it's like running a python file in CMD, only with py2exe at the end.
Say you have it on your desktop in a folder called lulz

open cmd
type cd desktop/lulz
then python whatever.py py2exe