How do I use cx_freeze?

后端 未结 5 947
心在旅途
心在旅途 2020-12-07 16:43

I\'ve created my setup.py file as instructed but I don\'t actually.. understand what to do next. Typing \"python setup.py build\" into the command line just gets a syntax er

5条回答
  •  渐次进展
    2020-12-07 17:20

    I'm really not sure what you're doing to get that error, it looks like you're trying to run cx_Freeze on its own, without arguments. So here is a short step-by-step guide on how to do it in windows (Your screenshot looks rather like the windows command line, so I'm assuming that's your platform)

    1. Write your setup.py file. Your script above looks correct so it should work, assuming that your script exists.

    2. Open the command line (Start -> Run -> "cmd")

    3. Go to the location of your setup.py file and run python setup.py build

    Notes:

    1. There may be a problem with the name of your script. "Main.py" contains upper case letters, which might cause confusion since windows' file names are not case sensitive, but python is. My approach is to always use lower case for scripts to avoid any conflicts.

    2. Make sure that python is on your PATH (read http://docs.python.org/using/windows.html)1

    3. Make sure are are looking at the new cx_Freeze documentation. Google often seems to bring up the old docs.

提交回复
热议问题