0

I have 4 .py files. Below is a list of files what is required to run the programme. Any of them missing will fail the programme to run.

Whole files

How my code works:

  1. ) GUIss.py imports demonstrator.py
  2. ) Demonstrator.py imports filereader.py and process.py
  3. ) To run the programm I just need to click GUIss.py.

My cx-freeze code below:

from cx_Freeze import setup,Executable

import os
includefiles = ['filereader.py','demonstrator.py','logo.gif','thebrighterchoice.gif']
    #bin_includes= ['process.py','demonstrator.py','filereader.py'] ..... 'bin_includes':bin_includesincludes = ['process']
    includes = ['process','tkinter']
    excludes = ['tkinter'] 
    packages = ['os','xlrd']
    setup(
        name = "Process",
        version = "0.1",
        description = "description",
        author = "Raitis Kupce",
        options = {'build_exe' :{'excludes': excludes,'includes':includes,'packages':packages,'include_files':includefiles}},
        executables = [Executable("GUIss.py")]
)

When I run compiled file I get an error message:

enter image description here

I then tried to write in setup.py (cx-freeze file)

                excludes = ['tkinter']
Then            includes = ['tkinter']
Afterwards      packages = ['tkinter']

Despite numerous attempt, no luck, same message all the time.

P.S

My python source code can be downloaded from https://github.com/Dragnets/Administration

I did studied hours from here and here and modifying endless times but no luck.

Community
  • 1
  • 1
Raitis Kupce
  • 760
  • 2
  • 7
  • 16
  • Closing immediately after it opened usually means there's an error that disappears before you can read it. If you run the exe it from the command line, do you see an error message? – Thomas K Oct 27 '14 at 15:18
  • @ThomasK Error - ImportError: No module named 'process' That is actually an other.py file that GUIss.py is dependent to run successfully. – Raitis Kupce Oct 27 '14 at 16:25
  • 1
    Try adding `'includes': ['process']` to the build_exe options, and freezing again. – Thomas K Oct 27 '14 at 17:43
  • @ThomasK I did add that but now it says No module named 'tkinter' I tried adding that too but no luck. I did successfully added module xlrd as it asked for that too. P.S I updated my code now. – Raitis Kupce Oct 27 '14 at 21:06
  • Does adding `'packages': ['tkinter']` help? – Thomas K Oct 27 '14 at 21:16
  • @ThomasK No!. I experiment a lot of different ways. trying other examples found in goggle but no luck so far. Did this one too. https://www.daniweb.com/software-development/python/threads/20774/starting-python/12#post1309905 . Didn't work. – Raitis Kupce Oct 27 '14 at 21:23
  • If you really have `excludes = ['TKinter']` in your setup file, that could be preventing it from copying tkinter. – Thomas K Oct 27 '14 at 21:49
  • @ThomasK I didn't quite get what you said. I tried several times to put this ['tkinter'] in excludes, includes, packages. Even change it to TKinter. Nothing changes, all the time the same message. Can't figure out what I am doing wrong. Technically it should be in excludes if I am correct. – Raitis Kupce Oct 28 '14 at 01:09
  • 1
    If something needs it, it definitely *shouldn't* be in excludes - I was confused because you showed it in excludes in your setup.py file. It is spelled `tkinter`, all lower case, in Python 3. Can you show the output from freezing it? It will be long, so put it in a pastebin. – Thomas K Oct 28 '14 at 02:12
  • @ThomasK Is this what you are looking for? I'm not good on terms. - http://oi57.tinypic.com/29gohtk.jpg – Raitis Kupce Oct 28 '14 at 02:31
  • Yes. It looks like it can't find tkinter. That's strange. Can you do `import tkinter; print(tkinter)` inside Python to see where it's installed? – Thomas K Oct 28 '14 at 20:04
  • @ThomasK It couldn,t print it. Ordinary my code was- `From tkinter import Tk, StringVar, ttk` and I also have 'from `tkinter.filedialog import *` So I could print(tkinter) but when I just added a line 'import tkinter'. It did print out the location of it. And ofcourse on new .py file it also shows tkinter location. – Raitis Kupce Oct 28 '14 at 22:47
  • and where did it say that it is? – Thomas K Oct 29 '14 at 00:55

0 Answers0