1

I tried all the previous available solutions available on Stackoverflow but nothing seems to work at all. I am using 64-bit python and python 3.6.1 by Anaconda.

Here is what I receive as an error while I run my exe:

Traceback (most recent call last):

File "C:\Users\Asgard\Anaconda3\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 14, in run
    module.run()
  File "C:\Users\Asgard\Anaconda3\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run
    exec(code, m.__dict__)
  File "fbroi.py", line 80, in <module>
    root = Tk(className=" ROI Calculator")
  File "C:\Users\Asgard\Anaconda3\lib\tkinter\__init__.py", line 2017, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: Can't find a usable tk.tcl in the following directories:
    {C:\Users\Asgard\Desktop\ML Proj\EdCrawler\build\exe.win-amd64-3.6\tk} {C:/Users/Asgard/Desktop/ML Proj/EdCrawler/build/exe.win-amd64-3.6/tcl/tk8.6} {C:/Users/Asgard/Desktop/ML Proj/EdCrawler/build/exe.win-amd64-3.6/tk8.6} {C:/Users/Asgard/Desktop/ML Proj/EdCrawler/build/lib/tk8.6} {C:/Users/Asgard/Desktop/ML Proj/EdCrawler/lib/tk8.6} {C:/Users/Asgard/Desktop/ML Proj/EdCrawler/build/library}

Copying tcl8.6 and tk8.6 directories here and there, don't seem to work also.

waqasgard
  • 801
  • 7
  • 25
  • can you share the setup file you use with cx-freeze? – James Kent Aug 18 '17 at 08:59
  • Sure. [link](http://ideone.com/AkldZ4) – waqasgard Aug 18 '17 at 09:05
  • in your `build_exe_options` try adding `tkinter` to your packages list. you are including the DLLs, but there are many "supporting" files that are also needed, including the package should fix that – James Kent Aug 18 '17 at 09:07
  • Nope. Did not work. Got the same error again. – waqasgard Aug 18 '17 at 09:10
  • in your build folder, you should have a `tk` and a `tcl` folder, can you check if you have a `tk.tcl` in the `tk folder? how many files/folders are present in each of these folders? – James Kent Aug 18 '17 at 10:05
  • Yes I have a tk and tcl folder. But tk.tcl is missing from tk folder. Each folder has 5 sub directories and 10 files under it. – waqasgard Aug 18 '17 at 10:31
  • @JamesKent Are you still looking into it? I tried a lot of other things but nothing seems to work for me. – waqasgard Aug 19 '17 at 07:28

1 Answers1

0

Ok, It seems that there is no possible solution for me. I had to get rid of cx_Freeze.

What works for me is this:

  1. Downgrade your python to 3.3 or less because py2exe does not support python 3.6. If you're using conda create a virtual environment. It easily allows installing any python version you want.
  2. Get py2exe on your python environment.
  3. Use py2exe.

You might find this useful : py2exe usage on Stackoverflow.

For people using conda : python and conda

waqasgard
  • 801
  • 7
  • 25