Frage

I made a program in python 2.7. I set up py2exe and made my program in to an executable file. I can run the .exe file perfectly fine. When I upload it on file hosting sites and people download it they aren't able to run it. The program closes instantly after the user clicks run. How can I fix this? All help is much appreciated.

Here is what my setup file looks like

from distutils.core import setup
import py2exe


setup(console=['mole calc.py']) 

I tried it with import time as well

Here is the beginning of the program

from __future__ import division
while True:
    value= raw_input("Welcome, chose the type of function you would like to use : Y = Moles to Particles, X = Particles to Moles, Z = Moles to Mass in Grams, C = Mass in Grams to Moles, V = Moles to Liters, B = Liters to moles ")


    if value in ['y', 'Y']:
            x= input ("Enter value of mole ")
            y=x*6.02*10**23
            print y
War es hilfreich?

Lösung

You need to distribute the entire "dist" directory, not just the exe file. See http://www.py2exe.org/index.cgi/FAQ (Section: "What are all those files?")

Andere Tipps

Looking at your file on mediafire, it looks like you did not provide nor explain to end users that they will need the Microsoft Visual C runtime DLL to run.

Re-read step 5 of the py2exe tutorial (http://www.py2exe.org/index.cgi/Tutorial#Step5)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top