0

I have built a tkinter GUI for survey entry in python3.4 that uses a number of packages. I then need to compile it to an executable so that I can put it on a coworkers machine (we both are on windows7 platform) I've structured my setup.py to look like:

from cx_Freeze import setup, Executable
import sys

base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(
        name='Survey Entry',
        version='3.5',
        license='MIT',
        description='GUI For entering survey data',
        executables= [Executable("Survey Entry.py", base=base)],
        options={"build_exe":{"packages":['tkinter','cx_Oracle','datetime','time','enter_survey','lookup',
                                          'queryfuncs','login','gui', 'datetime', 'add_respondent', 'possible_matches']}}
)

This worked absolutely fine for tons of versions. But then I added a functionality that uses fuzzywuzzy to compare strings. When I include that and add fuzzywuzzy to the packages list in the options dictionary and compile it, I get a big error when I try to run the exe that ends with ImportError: No module named 'Levenshtein'

I don't understand because in my development the module works fine. I've tried to include Levenshtein in the setup but it doesn't exist as a module. I don't have python-Levenshtein installed though because I can't get the .whl to install on my windows machine.

Has anyone ran into this? Why would fuzzywuzzy cause this error when it runs fine through python? Is there something I'm missing?

The complete error can be seen here: https://i.stack.imgur.com/M9egF.jpg

EDIT: I was able to figure it out - I need the python-Levenshtein module installed, had to keep working at it to get the .whl to install (apparently I'm not as proficient with the command prompt as I wanted to believe). After that I included Levenshtein and fuzzywuzzy in the packages list and it compiled without error.

I'm going to leave this up because I couldn't find this on a google search so hopefully no one else falls victim!

Djones4822
  • 577
  • 3
  • 6
  • 23

1 Answers1

0

Found the solution - python-Levenshtein needs to be installed. Got mine from gohlke's repository: http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-levenshtein - make sure you have the platform that matches your python installation! I run a x64 windows but I use x32 python for compatibility with my Oracle driver - so I needed to install the 32-bit module.

Djones4822
  • 577
  • 3
  • 6
  • 23