3

I have developed a tkinter application but I need other users (with Windows 10 OS) to use it. Some have a python interpreter installed but others don't. I tried to create an executable through py2exe and auto py-to-exe but none worked. I also tried to run the tkinter through pythonanywhere.com but it also didn't work.

Is there a simply way to share the py files? Perhaps is there a click-to-run environment? What I don't need is to request users to install a full python application such as anaconda or WinPython, as this does not make sense for the users without a python interpreter.

DAIRAV
  • 723
  • 1
  • 9
  • 31

2 Answers2

2

I would use pyinstaller

run cmd.exe as Administartor and type:

pip install pyinstaller

then run with:

pyinstaller --onefile --noconsole --name your_script.py

This creates a single file executable which also includes your Python with all dependencies of your script/project.

If your projects contains external files like images/sounds you might need to edit the spec file as described here.

Aoki Ahishatsu
  • 495
  • 1
  • 6
  • 15
  • Hi @Aoki Ahishatsu, I tried pyinstaller but there was a recursion error on pyinstaller recursionerror maximum recursion depth. Any idea on how to solve it? I read that I should downgrade, but if there is another way I would prefer (this involves asking IT to install it for me and takes too much effort for doing so). – Rafael Castelo Branco Dec 05 '18 at 09:16
0

Full credit to the kid who made this video, it helped me out a lot when I had the same style of problem as you. https://www.youtube.com/watch?v=pzc4vYqbruk You'll just have to go through the generated .zip file to find the generated .exe file.

  • Hi @Noel, Definitely the video is quite good, but my .exe does not open. It prompts a cmd window and shuts right after. Do you have any idea why? – Rafael Castelo Branco Dec 05 '18 at 13:32
  • @RafaelCasteloBranco Could you comment a picture of the build directory if the zip file that is created. Could you also exactly name the python file you are trying to compile, and the .exe that prompted the cmd window. –  Dec 05 '18 at 21:59