5

We are trying to make our python script execute itself as a .exe file, without having python installed. Like if we give our program to someone else, they wouldn't need to install python to open it.

It is a text-based game like zork, so we need a gui, like cmd, to run it.

We have tried using py2exe, and pyinstaller, but none of them made any sense, and don't work with 2.7.3 for some reason.

Any help?

5
  • Also, could you make a python script open cmd, with the path to the file, so that you can run it from there? With python installed of course. I see that as much easier than making an executable anyways. Just trying to look for something else than having to type the whole C:\python27\python.exe game.py shebang. Commented Dec 9, 2012 at 0:56
  • 1
    Why don't py2exe and pyinstaller make sense? Commented Dec 9, 2012 at 0:57
  • @poplitea When we try installing it, it either: Doesn't find python 2.7, or: doesn't work installing at all. Commented Dec 9, 2012 at 1:20
  • They both should work with python 2.7. I would suggest sticking with pyinstaller. Commented Dec 9, 2012 at 1:28
  • @jdi We fixed it with cx_freeze. Commented Dec 9, 2012 at 2:09

4 Answers 4

3

Assuming you have pip installed which you should after installing Python inside folder Scripts. Install PyInstaller using pip, type in the command prompt the following.

  • pip install pyinstaller

After you install PyInstaller locate where your pyinstaller files are (they should be where your pip files are inside the Scripts folder) and go to the command prompt and type the following.

  • c:\python27\Scripts>pyinstaller --onefile c:\yourscript.py

The above command will create a folder called “dist” inside the Scripts folder, this will contain your single executable file “yourscript.exe”.

Sign up to request clarification or add additional context in comments.

1 Comment

the easiest solution so far :)
1

Can always try http://cx-freeze.sourceforge.net, works with all versions of python including 3.3.

5 Comments

Tried to find a good tutorial on how to use that software. We have it now, but we can't find out how to use it. We can't even find an exe file in there...
It should download as a MSI and can auto-install. Documentation is here: cx_freeze.readthedocs.org/en/latest/index.html. Can you describe your issue in more detail?
Ok, we found everything, the compiler and all. We get the error "Cannot get zipimporter instance"
Can you expand on this some?
we fixed it! We were just using the wrong syntax when we were exporting the file xD
1

Check out this wiki on deploying Python applications:

http://wiki.python.org/moin/deployment

In addition to what's already been mentioned, it has links to Movable Python, Python-Packager, and others.

1 Comment

Those deployments are either for mac, linux or older versions of python. We're using windows 7 32-bit and python 2.7 :/
-4

Download this, should work for python 2.7.3

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.